Class: RailsPlan::Cli::FetchTemplate
- Inherits:
-
Object
- Object
- RailsPlan::Cli::FetchTemplate
- Defined in:
- lib/rails_plan/cli/fetch_template.rb
Constant Summary collapse
- API_URL =
'https://railsplan.com/api/v1'
Instance Method Summary collapse
Instance Method Details
#call(uid) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/rails_plan/cli/fetch_template.rb', line 8 def call(uid) response = RestClient.get(API_URL + "/bootstrap_plans/#{uid}") { |res| res } return if response.code != 200 JSON.parse(response.body) end |
#gem_version ⇒ Object
16 17 18 19 20 21 |
# File 'lib/rails_plan/cli/fetch_template.rb', line 16 def gem_version response = RestClient.get(API_URL + "/bootstrap_plans/gem_current_version") parsed_response = JSON.parse(response.body) parsed_response['version'] end |