Class: MyCLI
- Inherits:
-
Thor
- Object
- Thor
- MyCLI
- Includes:
- FactoryBot::Syntax::Methods
- Defined in:
- MyCLI.rb
Instance Method Summary collapse
Instance Method Details
#hello ⇒ Object
10 11 12 |
# File 'MyCLI.rb', line 10 def hello puts "hellooooooo" end |
#load(file) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'MyCLI.rb', line 20 def load(file) JSONModel::init(:client_mode => true, :url => [:backend_url], :allow_other_unmapped => true, :priority => :high) eval(File.open(File.([:definitions])).read) auth = JSONModel::HTTP.post_form('/users/admin/login', { password: 'admin' }) JSONModel::HTTP.current_backend_session = JSON.parse(auth.body)['session'] eval(File.open(File.(file)).read) end |