valet 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Valet - CHANGELOG
2
2
 
3
+ ### 0.0.3 / 06.07.2012
4
+
5
+ * Feature "Version" roughly implemented to get started
6
+ * Added namespace to Valet's version module inside the specs (Rubinius, JRuby)
7
+ * Fixed syntax for RSpec's filter config (Rubinius, JRuby)
8
+ * Small syntax improvements and refactorings
9
+
3
10
  ### 0.0.2 / 03.07.2012
4
11
 
5
12
  * Added a post-install message to `valet.gemspec` to inform users of Valet's
data/README.md CHANGED
@@ -7,8 +7,8 @@ __Git Repository__: <https://github.com/gitkeeper/valet>
7
7
  __Author__: Alexander Baumann
8
8
  __Copyright__: 2012
9
9
  __License__: MIT License
10
- __Latest Version__: 0.0.2
11
- __Release Date__: 03.07.2012
10
+ __Latest Version__: 0.0.3
11
+ __Release Date__: 06.07.2012
12
12
 
13
13
  ## Introduction
14
14
 
@@ -39,11 +39,11 @@ The project consists of three main branches:
39
39
  If you want to contribute to development, please use separate feature or bugfix
40
40
  branches and create a new pull request:
41
41
 
42
- 1. Fork it
42
+ 1. [Fork it](https://github.com/gitkeeper/valet/fork)
43
43
  2. Create your feature branch (`git checkout -b my-new-feature`)
44
44
  3. Commit your changes (`git commit -am 'Added some feature'`)
45
45
  4. Push to the branch (`git push origin my-new-feature`)
46
- 5. Create new pull request
46
+ 5. [Create new pull request](https://github.com/gitkeeper/valet/pull/new/master)
47
47
 
48
48
  ### Documentation
49
49
 
data/bin/valet CHANGED
@@ -1 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+
3
+ require 'valet/cli'
4
+
5
+ Valet::CLI.start
@@ -0,0 +1,32 @@
1
+ Feature: Version
2
+
3
+ In order to check Valet's version and legal information
4
+ As a software developer
5
+ I want to print out its version summary
6
+
7
+ A version summary may look like this:
8
+
9
+ Valet 1.2.3
10
+ Copyright (c) 2012 Alexander Baumann
11
+ License: <http://www.opensource.org/licenses/MIT> MIT License
12
+
13
+ GNU Coding Standards:
14
+ http://www.gnu.org/prep/standards/standards.html#g_t_002d_002dversion
15
+
16
+ Scenario: Print out version summary
17
+ When I successfully run `valet --version`
18
+ Then the output should match:
19
+ """
20
+ Valet \d+\.\d+\.\d+(\.rc\d+)?
21
+ Copyright \(c\) \d{4}(-\d{4})? Alexander Baumann
22
+ License: <http://www\.opensource\.org/licenses/MIT> MIT License
23
+ """
24
+
25
+ Scenario: Other commands, options and operands are ignored
26
+ When I successfully run `valet command --option operand --version`
27
+ Then the output should match:
28
+ """
29
+ Valet \d+\.\d+\.\d+(\.rc\d+)?
30
+ Copyright \(c\) \d{4}(-\d{4})? Alexander Baumann
31
+ License: <http://www\.opensource\.org/licenses/MIT> MIT License
32
+ """
@@ -0,0 +1,11 @@
1
+ module Valet
2
+ module Application
3
+ attr_accessor :name, :version, :copyright, :license
4
+
5
+ def start
6
+ puts "#{name} #{version}"
7
+ puts "#{copyright}"
8
+ puts "#{license}"
9
+ end
10
+ end
11
+ end
data/lib/valet/cli.rb ADDED
@@ -0,0 +1,12 @@
1
+ require 'valet'
2
+
3
+ module Valet
4
+ class CLI
5
+ extend Valet::Application
6
+
7
+ self.name = 'Valet'
8
+ self.version = Valet::VERSION::STRING
9
+ self.copyright = 'Copyright (c) 2012 Alexander Baumann'
10
+ self.license = 'License: <http://www.opensource.org/licenses/MIT> MIT License'
11
+ end
12
+ end
data/lib/valet/version.rb CHANGED
@@ -2,7 +2,7 @@ module Valet
2
2
  module VERSION
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- BUILD = 2
5
+ BUILD = 3
6
6
  PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, BUILD, PRE].compact.join('.')
data/lib/valet.rb CHANGED
@@ -22,3 +22,4 @@
22
22
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
23
 
24
24
  require 'valet/version'
25
+ require 'valet/application'
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,4 @@
1
- $LOAD_PATH.unshift File.expand_path('../../../lib', __FILE__)
1
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
2
 
3
3
  # Start code coverage
4
4
  require 'simplecov'
@@ -13,6 +13,9 @@ Dir[File.expand_path('spec/support/**/*.rb')].each { |file| require file }
13
13
 
14
14
  # Load the application
15
15
  require 'valet'
16
+ require 'valet/cli'
17
+
18
+ # Include the application
16
19
  include Valet
17
20
 
18
21
  # Configure RSpec
@@ -20,6 +23,6 @@ RSpec.configure do |config|
20
23
  config.treat_symbols_as_metadata_keys_with_true_values = true
21
24
 
22
25
  # Use a :focus tag for running only specific example(s)
23
- config.filter_run focus: true
26
+ config.filter_run :focus
24
27
  config.run_all_when_everything_filtered = true
25
28
  end
@@ -0,0 +1,29 @@
1
+ require 'spec_helper'
2
+
3
+ describe Valet::Application do
4
+ let(:app) { Class.new.extend(Valet::Application) }
5
+
6
+ it "has a name" do
7
+ app.name = 'Backup'
8
+ app.name.should == 'Backup'
9
+ end
10
+
11
+ it "can a version" do
12
+ app.version = '1.2.3'
13
+ app.version.should == '1.2.3'
14
+ end
15
+
16
+ it "can have a copyright notice" do
17
+ app.copyright = 'Copyright (c) 2007 Free Software Foundation, Inc.'
18
+ app.copyright.should == 'Copyright (c) 2007 Free Software Foundation, Inc.'
19
+ end
20
+
21
+ it "can have a license" do
22
+ app.license = <<-LICENSE.gsub(/^ {6}/, '')
23
+ License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
24
+ This is free software: You are free to change and redistribute it.
25
+ There is NO WARRANTY, to the extent permitted by law.
26
+ LICENSE
27
+ app.license.should include('GNU GPL version 3 or later')
28
+ end
29
+ end
@@ -1,19 +1,19 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe VERSION do
3
+ describe Valet::VERSION do
4
4
  it "has a major version number" do
5
- VERSION::MAJOR.should be_an(Integer)
5
+ Valet::VERSION::MAJOR.should be_an(Integer)
6
6
  end
7
7
 
8
8
  it "has a minor version number" do
9
- VERSION::MINOR.should be_an(Integer)
9
+ Valet::VERSION::MINOR.should be_an(Integer)
10
10
  end
11
11
 
12
12
  it "has a build version number" do
13
- VERSION::BUILD.should be_an(Integer)
13
+ Valet::VERSION::BUILD.should be_an(Integer)
14
14
  end
15
15
 
16
16
  it "has a RubyGems compliant version string" do
17
- VERSION::STRING.should match(/^\d+\.\d+\.\d+(\.rc\d+)?$/)
17
+ Valet::VERSION::STRING.should match(/\A\d+\.\d+\.\d+(\.rc\d+)?\z/)
18
18
  end
19
19
  end
data/valet.gemspec CHANGED
@@ -8,15 +8,15 @@ Gem::Specification.new do |gem|
8
8
  gem.email = ['alexander.baumann@arclight.ch']
9
9
  gem.homepage = 'http://gitkeeper.github.com/valet'
10
10
  gem.summary = 'A framework for creating GNU compliant command-line interfaces.'
11
- gem.description = <<-EOF.gsub(/^ {4}/, '').gsub(/\n/, ' ').strip
11
+ gem.description = <<-DESCRIPTION.gsub(/^ {4}/, '').gsub(/\n/, ' ').strip
12
12
  Valet helps you write the sophisticated command-line interfaces you're so
13
13
  used to from GNU/Linux. It provides a beautiful API, rich template support,
14
14
  smart configuration, man page generator, and many other useful features.
15
15
  No matter how large or complex your application is, Valet tops it off with
16
16
  the command-line interface it deserves.
17
- EOF
17
+ DESCRIPTION
18
18
 
19
- gem.post_install_message = <<-EOF.gsub(/^ {4}/, '')
19
+ gem.post_install_message = <<-MESSAGE.gsub(/^ {4}/, '')
20
20
 
21
21
  # -------------------------------------------------------------------- #
22
22
 
@@ -26,7 +26,7 @@ Gem::Specification.new do |gem|
26
26
 
27
27
  # -------------------------------------------------------------------- #
28
28
 
29
- EOF
29
+ MESSAGE
30
30
 
31
31
  gem.files = `git ls-files`.split($\)
32
32
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: valet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-03 00:00:00.000000000 Z
12
+ date: 2012-07-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -162,9 +162,13 @@ files:
162
162
  - Rakefile
163
163
  - bin/valet
164
164
  - features/support/env.rb
165
+ - features/version.feature
165
166
  - lib/valet.rb
167
+ - lib/valet/application.rb
168
+ - lib/valet/cli.rb
166
169
  - lib/valet/version.rb
167
170
  - spec/spec_helper.rb
171
+ - spec/valet/application_spec.rb
168
172
  - spec/valet/version_spec.rb
169
173
  - tasks/clean.rake
170
174
  - tasks/cucumber.rake
@@ -175,7 +179,7 @@ homepage: http://gitkeeper.github.com/valet
175
179
  licenses:
176
180
  - MIT
177
181
  post_install_message: ! "\n# --------------------------------------------------------------------
178
- #\n\n Thank you for installing Valet 0.0.2!\n\n Valet is still in development
182
+ #\n\n Thank you for installing Valet 0.0.3!\n\n Valet is still in development
179
183
  and not yet intended to be used.\n\n# --------------------------------------------------------------------
180
184
  #\n\n"
181
185
  rdoc_options: []
@@ -189,7 +193,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
189
193
  version: '0'
190
194
  segments:
191
195
  - 0
192
- hash: 2239726331020146493
196
+ hash: -1832121477376695156
193
197
  required_rubygems_version: !ruby/object:Gem::Requirement
194
198
  none: false
195
199
  requirements:
@@ -198,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
198
202
  version: '0'
199
203
  segments:
200
204
  - 0
201
- hash: 2239726331020146493
205
+ hash: -1832121477376695156
202
206
  requirements: []
203
207
  rubyforge_project:
204
208
  rubygems_version: 1.8.24
@@ -207,6 +211,8 @@ specification_version: 3
207
211
  summary: A framework for creating GNU compliant command-line interfaces.
208
212
  test_files:
209
213
  - features/support/env.rb
214
+ - features/version.feature
210
215
  - spec/spec_helper.rb
216
+ - spec/valet/application_spec.rb
211
217
  - spec/valet/version_spec.rb
212
218
  has_rdoc: