consular 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/consular/cli.rb CHANGED
@@ -116,6 +116,24 @@ module Consular
116
116
  open_in_editor path, options[:editor]
117
117
  end
118
118
 
119
+ # Create a Termfile in the current or specified directory
120
+ #
121
+ # @example
122
+ #
123
+ # # create Termfile in current directory
124
+ # Consular::CLI.start ['create']
125
+ # # create Termfile in /tmp
126
+ # Consular::CLI.start ['create', '-r=/tmp']
127
+ #
128
+ # @api public
129
+ desc "create", "create a Termfile in directory"
130
+ method_option :root, :type => :string, :default => '.', :aliases => '-r'
131
+ method_option :editor, :type => :string, :default => nil, :aliases => '-e'
132
+ method_option :capture, :type => :boolean, :default => false, :aliases => '-c'
133
+ def create
134
+ invoke :edit, [], options
135
+ end
136
+
119
137
  # Delete the global script or Termfile
120
138
  #
121
139
  # @param [String] project
@@ -1,3 +1,3 @@
1
1
  module Consular
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
data/spec/cli_spec.rb CHANGED
@@ -227,6 +227,16 @@ describe Consular::CLI do
227
227
  assert_match /setup/, File.read('/tmp/Termfile')
228
228
  end
229
229
 
230
+ it "alias create" do
231
+ FakeFS.deactivate!
232
+ Consular::CLI.any_instance.expects(:open_in_editor).with('/tmp/Termfile', nil).returns(true)
233
+ output = capture_io { Consular::CLI.start ['create', '-r=/tmp'] }.join('')
234
+
235
+ assert_match /create/, output
236
+ assert_match /Termfile/, output
237
+ assert_match /setup/, File.read('/tmp/Termfile')
238
+ end
239
+
230
240
  end
231
241
 
232
242
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: consular
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Arthur Chiu
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-23 00:00:00 -07:00
18
+ date: 2011-10-26 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency