Class: Bower::Environment
- Inherits:
-
Object
- Object
- Bower::Environment
- Defined in:
- lib/bower/environment.rb
Constant Summary collapse
- DEFAULT_DIRECTORY =
'bower_components'
- DEFAULT_JSON =
'bower.json'
Instance Attribute Summary collapse
-
#directory ⇒ Object
Returns the value of attribute directory.
-
#json ⇒ Object
readonly
Returns the value of attribute json.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(config = {}) ⇒ Environment
constructor
A new instance of Environment.
- #install ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(config = {}) ⇒ Environment
Returns a new instance of Environment.
20 21 22 23 |
# File 'lib/bower/environment.rb', line 20 def initialize(config={}) @directory = config['directory'] || DEFAULT_DIRECTORY @json = DEFAULT_JSON end |
Instance Attribute Details
#directory ⇒ Object
Returns the value of attribute directory.
5 6 7 |
# File 'lib/bower/environment.rb', line 5 def directory @directory end |
#json ⇒ Object (readonly)
Returns the value of attribute json.
6 7 8 |
# File 'lib/bower/environment.rb', line 6 def json @json end |
Class Method Details
.setup(bowerrc = nil) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/bower/environment.rb', line 11 def self.setup(bowerrc=nil) if bowerrc && File.exists?(bowerrc) conf = MultiJson.load(File.open(bowerrc)) Environment.new(conf) else Environment.new end end |
Instance Method Details
#install ⇒ Object
25 26 27 |
# File 'lib/bower/environment.rb', line 25 def install run('bower install') end |
#update ⇒ Object
29 30 31 |
# File 'lib/bower/environment.rb', line 29 def update run('bower update') end |