interstate 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/interstate.rb CHANGED
@@ -87,15 +87,12 @@ class Interstate < Thor
87
87
 
88
88
  # add
89
89
  desc "add", "Add a new road to current roadmap"
90
+ method_option :title, :type => :string, :aliases => "-t", :required => true, :desc => "Title of the new road. REQUIRED"
91
+ method_option :description, :type => :string, :aliases => "-d", :required => true, :desc => "Description of the new road. REQUIRED."
90
92
  def add
91
93
  # Get user input
92
94
  id = @@maps[@@current_map]["_id"]
93
- puts "\nAdding a road to #{@@maps[@@current_map]["title"]}".bright
94
- puts "Title:"
95
- title = STDIN.gets
96
- puts "Description:"
97
- desc = STDIN.gets
98
- params = { :roadmapId => "#{id}", :title => "#{title}", :description => "#{desc}" }
95
+ params = { :roadmapId => "#{id}", :title => "#{options.title}", :description => "#{options.description}" }
99
96
 
100
97
  # POST the road to the API
101
98
  road = API.add_road(params)
@@ -111,7 +108,7 @@ class Interstate < Thor
111
108
 
112
109
  # update
113
110
  desc "update", "Update a road"
114
- method_option :message, :type => :string, :aliases => "-m", :desc => "A required update message."
111
+ method_option :message, :type => :string, :aliases => "-m", :required => true, :desc => "A required update message."
115
112
  method_option :status, :type => :string, :aliases => "-s", :default => nil, :desc => "Displays a guide and prompts you for a new status code."
116
113
  def update(roadID)
117
114
  if @@roads[@@current_map][roadID] == nil
@@ -1,3 +1,3 @@
1
1
  module Interstate
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Alec Sloman
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-06-08 00:00:00 +09:00
17
+ date: 2011-06-09 00:00:00 +09:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency