Class: Develry::Site
- Inherits:
-
Object
- Object
- Develry::Site
- Defined in:
- lib/develry/site.rb,
lib/develry/site/initializer.rb
Overview
Encapsulates a specific Project develry is used for
Defined Under Namespace
Classes: Initializer
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
-
#init ⇒ undefined
private
Initialize develry using default config.
-
#init_spec_helper ⇒ self
private
Initialize project and load shared specs.
-
#initialize(project) ⇒ Site
constructor
A new instance of Site.
-
#sync ⇒ undefined
private
Sync gemfiles.
-
#update ⇒ undefined
private
Sync gemfiles and run bundle update.
Constructor Details
#initialize(project) ⇒ Site
Returns a new instance of Site.
12 13 14 15 |
# File 'lib/develry/site.rb', line 12 def initialize(project) @project = project @root = project.root end |
Instance Attribute Details
#project ⇒ Object (readonly)
Returns the value of attribute project.
10 11 12 |
# File 'lib/develry/site.rb', line 10 def project @project end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
8 9 10 |
# File 'lib/develry/site.rb', line 8 def root @root end |
Instance Method Details
#init ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize develry using default config
34 35 36 37 38 |
# File 'lib/develry/site.rb', line 34 def init Initializer.call(self) puts 'Run bundle install to complete the develry installation' self end |
#init_spec_helper ⇒ self
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize project and load shared specs
Expects to be called from $application_root/spec/spec_helper.rb
24 25 26 27 |
# File 'lib/develry/site.rb', line 24 def init_spec_helper Project::Initializer::Rspec.call(project) self end |
#sync ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Sync gemfiles
45 46 47 48 49 50 |
# File 'lib/develry/site.rb', line 45 def sync target = root.join(GEMFILE_NAME) FileUtils.cp(SHARED_GEMFILE_PATH, target) puts "Successfully synced #{target}" self end |
#update ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Sync gemfiles and run bundle update
57 58 59 60 61 |
# File 'lib/develry/site.rb', line 57 def update sync system(BUNDLE_UPDATE) self end |