Class: AppUp::Hooks::RailsUp
- Defined in:
- lib/app_up/hooks/rails_up.rb
Constant Summary collapse
- BUNDLE_COMMAND =
"bundle --local || bundle"
Instance Attribute Summary
Attributes inherited from Hook
Instance Method Summary collapse
-
#initialize(*args) ⇒ RailsUp
constructor
A new instance of RailsUp.
- #run ⇒ Object
Methods inherited from Hook
Constructor Details
#initialize(*args) ⇒ RailsUp
8 9 10 11 |
# File 'lib/app_up/hooks/rails_up.rb', line 8 def initialize(*args) @commands = {} super(*args) end |
Instance Method Details
#run ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/app_up/hooks/rails_up.rb', line 13 def run shell.notify( "Running RailsUp\n----------") files.each do |file| if File.basename(file) == "Gemfile.lock" add_command(:bundle, dir: File.split(file)[0]) end if file.match(/db\/migrate/) add_command(:migrate, dir: file.sub(/\/db\/migrate\/.*/, '')) end end enqueue_commands end |