tcravit_ruby_lib 0.0.8 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,139 @@
1
+ ############################################################################
2
+ # TcravitRubyLib: Random useful stuff for Ruby programming.
3
+ #
4
+ # File : version_bump_rake_tasks_spec.rb
5
+ # Specs for : version:bump rake tasks in tcravit_ruby_lib/rake_tasks
6
+ ############################################################################
7
+ # Copyright 2011-2018, Tammy Cravit.
8
+ #
9
+ # Licensed under the Apache License, Version 2.0 (the "License");
10
+ # you may not use this file except in compliance with the License.
11
+ # You may obtain a copy of the License at
12
+ #
13
+ # http://www.apache.org/licenses/LICENSE-2.0
14
+ #
15
+ # Unless required by applicable law or agreed to in writing, software
16
+ # distributed under the License is distributed on an "AS IS" BASIS,
17
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+ ############################################################################
21
+
22
+ require 'spec_helper'
23
+ require "rake"
24
+ require "tcravit_ruby_lib/rake_tasks"
25
+ require "fantaskspec"
26
+
27
+ require_custom_matcher_named("be_a_rake_task_named")
28
+ require_custom_matcher_named("be_a_valid_gem_version_file_for")
29
+ require_custom_matcher_named("declare_the_gem_version_to_be")
30
+
31
+ TEST_VERSION_FILE = "/tmp/bump_ver.out"
32
+
33
+ describe "version:bump:major", type: :rake do
34
+ context "the basics" do
35
+ it "should be a rake task" do
36
+ expect(subject).to be_a_rake_task_named("version:bump:major")
37
+ end
38
+ end
39
+
40
+ context "file generation" do
41
+ before(:each) do
42
+ File.delete(TEST_VERSION_FILE) if File.exist?("/tmp/bump_ver.out")
43
+ end
44
+
45
+ it "should generate a file with the right format and module name" do
46
+ args = to_task_arguments(1)
47
+ task.execute(args)
48
+ expect(TEST_VERSION_FILE).to be_a_valid_gem_version_file_for("TcravitRubyLib")
49
+ end
50
+
51
+ it "should increment the major version number" do
52
+ initial_version = TcravitRubyLib::VERSION_DATA.clone
53
+ args = to_task_arguments(1)
54
+ task.execute(args)
55
+ expect(TEST_VERSION_FILE).to declare_the_gem_version_to_be((initial_version[0] + 1), initial_version[1], initial_version[2])
56
+ end
57
+ end
58
+ end
59
+
60
+ describe "version:bump:minor", type: :rake do
61
+ context "the basics" do
62
+ it "should be a rake task" do
63
+ expect(subject).to be_a_rake_task_named("version:bump:minor")
64
+ end
65
+ end
66
+
67
+ context "file generation" do
68
+ before(:each) do
69
+ File.delete(TEST_VERSION_FILE) if File.exist?("/tmp/bump_ver.out")
70
+ end
71
+
72
+ it "should generate a file with the right format and module name" do
73
+ args = to_task_arguments(1)
74
+ task.execute(args)
75
+ expect(TEST_VERSION_FILE).to be_a_valid_gem_version_file_for("TcravitRubyLib")
76
+ end
77
+
78
+ it "should increment the minor version number" do
79
+ initial_version = TcravitRubyLib::VERSION_DATA.clone
80
+ args = to_task_arguments(1)
81
+ task.execute(args)
82
+ expect(TEST_VERSION_FILE).to declare_the_gem_version_to_be(initial_version[0], (initial_version[1] + 1), initial_version[2])
83
+ end
84
+ end
85
+ end
86
+
87
+ describe "version:bump:build", type: :rake do
88
+ context "the basics" do
89
+ it "should be a rake task" do
90
+ expect(subject).to be_a_rake_task_named("version:bump:build")
91
+ end
92
+ end
93
+
94
+ context "file generation" do
95
+ before(:each) do
96
+ File.delete(TEST_VERSION_FILE) if File.exist?("/tmp/bump_ver.out")
97
+ end
98
+
99
+ it "should generate a file with the right format and module name" do
100
+ args = to_task_arguments(1)
101
+ task.execute(args)
102
+ expect(TEST_VERSION_FILE).to be_a_valid_gem_version_file_for("TcravitRubyLib")
103
+ end
104
+
105
+ it "should increment build version number" do
106
+ initial_version = TcravitRubyLib::VERSION_DATA.clone
107
+ args = to_task_arguments(1)
108
+ task.execute(args)
109
+ expect(TEST_VERSION_FILE).to declare_the_gem_version_to_be(initial_version[0], initial_version[1], (initial_version[2] + 1))
110
+ end
111
+ end
112
+ end
113
+
114
+ describe "version:bump:set", type: :rake do
115
+ context "the basics" do
116
+ it "should be a rake task" do
117
+ expect(subject).to be_a_rake_task_named("version:bump:set")
118
+ end
119
+ end
120
+
121
+ context "file generation" do
122
+ before(:each) do
123
+ File.delete(TEST_VERSION_FILE) if File.exist?("/tmp/bump_ver.out")
124
+ end
125
+
126
+ it "should generate a file with the right format and module name" do
127
+ args = to_task_arguments(3,4,5,11)
128
+ task.execute(args)
129
+ expect(TEST_VERSION_FILE).to be_a_valid_gem_version_file_for("TcravitRubyLib")
130
+ end
131
+
132
+ it "should generate a file with the right version number" do
133
+ args = to_task_arguments(3,4,5,1)
134
+ task.execute(args)
135
+ expect(TEST_VERSION_FILE).to declare_the_gem_version_to_be(3, 4, 5)
136
+ end
137
+ end
138
+ end
139
+
@@ -6,9 +6,10 @@ Gem::Specification.new do |s|
6
6
  s.name = "tcravit_ruby_lib"
7
7
  s.version = TcravitRubyLib::VERSION
8
8
  s.authors = ["Tammy Cravit"]
9
- s.email = ["tcravit@taylored-software.com"]
10
- s.homepage = ""
9
+ s.email = ["tammycravit@me.com"]
10
+ s.homepage = "https://github.com/tammycravit/tcravit_ruby_lib"
11
11
  s.summary = %q{Random reusable ruby stuff}
12
+ s.license = 'Apache-2.0'
12
13
 
13
14
  s.rubyforge_project = "tcravit_ruby_lib"
14
15
 
@@ -17,7 +18,10 @@ Gem::Specification.new do |s|
17
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
19
  s.require_paths = ["lib"]
19
20
 
20
- s.add_development_dependency "rspec"
21
- s.add_development_dependency "rake"
22
- # s.add_runtime_dependency "rest-client"
21
+ s.add_dependency 'simple-password-gen', '~> 0.1'
22
+
23
+ s.add_development_dependency 'rspec', '~> 3.7'
24
+ s.add_development_dependency 'rake', '~> 12.3'
25
+ s.add_development_dependency 'fantaskspec', '~> 1.1'
26
+ s.add_development_dependency 'coderay', '~> 1.1'
23
27
  end
metadata CHANGED
@@ -1,88 +1,144 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tcravit_ruby_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
5
- prerelease:
4
+ version: 0.2.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - Tammy Cravit
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2011-12-06 00:00:00.000000000 Z
11
+ date: 2018-02-05 00:00:00.000000000 Z
13
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: simple-password-gen
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.1'
14
27
  - !ruby/object:Gem::Dependency
15
28
  name: rspec
16
- requirement: &70218291081820 !ruby/object:Gem::Requirement
17
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
18
30
  requirements:
19
- - - ! '>='
31
+ - - "~>"
20
32
  - !ruby/object:Gem::Version
21
- version: '0'
33
+ version: '3.7'
22
34
  type: :development
23
35
  prerelease: false
24
- version_requirements: *70218291081820
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.7'
25
41
  - !ruby/object:Gem::Dependency
26
42
  name: rake
27
- requirement: &70218291079960 !ruby/object:Gem::Requirement
28
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
29
44
  requirements:
30
- - - ! '>='
45
+ - - "~>"
31
46
  - !ruby/object:Gem::Version
32
- version: '0'
47
+ version: '12.3'
33
48
  type: :development
34
49
  prerelease: false
35
- version_requirements: *70218291079960
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '12.3'
55
+ - !ruby/object:Gem::Dependency
56
+ name: fantaskspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.1'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: coderay
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.1'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.1'
36
83
  description:
37
84
  email:
38
- - tcravit@taylored-software.com
85
+ - tammycravit@me.com
39
86
  executables: []
40
87
  extensions: []
41
88
  extra_rdoc_files: []
42
89
  files:
43
- - .gitignore
44
- - .travis.yml
45
- - CHANGELOG.md
90
+ - ".gitignore"
91
+ - ".ruby-gemset"
92
+ - ".ruby-version"
93
+ - ".travis.yml"
46
94
  - Gemfile
47
95
  - README.md
48
96
  - Rakefile
49
97
  - lib/tcravit_ruby_lib.rb
98
+ - lib/tcravit_ruby_lib/app_banner.rb
50
99
  - lib/tcravit_ruby_lib/app_config.rb
51
100
  - lib/tcravit_ruby_lib/config_searcher.rb
101
+ - lib/tcravit_ruby_lib/configurable.rb
52
102
  - lib/tcravit_ruby_lib/on_execute.rb
103
+ - lib/tcravit_ruby_lib/rake_tasks.rb
104
+ - lib/tcravit_ruby_lib/tasks/bump_ver.rake
53
105
  - lib/tcravit_ruby_lib/utility.rb
54
106
  - lib/tcravit_ruby_lib/version.rb
107
+ - spec/app_banner_spec.rb
108
+ - spec/app_config_spec.rb
109
+ - spec/config_searcher_spec.rb
110
+ - spec/configurable_spec.rb
111
+ - spec/global_spec.rb
55
112
  - spec/spec_helper.rb
56
- - spec/tcravit_ruby_lib/app_config_spec.rb
57
- - spec/tcravit_ruby_lib/config_searcher_spec.rb
58
- - spec/tcravit_ruby_lib/utility_spec.rb
113
+ - spec/support/matchers/be_a_rake_task_named_matcher.rb
114
+ - spec/support/matchers/be_a_valid_gem_version_file_for_matcher.rb
115
+ - spec/support/matchers/declare_the_gem_version_to_be_matcher.rb
116
+ - spec/support/matchers/matcher_helpers.rb
117
+ - spec/utility_spec.rb
118
+ - spec/version_bump_rake_tasks_spec.rb
59
119
  - tcravit_ruby_lib.gemspec
60
- homepage: ''
61
- licenses: []
120
+ homepage: https://github.com/tammycravit/tcravit_ruby_lib
121
+ licenses:
122
+ - Apache-2.0
123
+ metadata: {}
62
124
  post_install_message:
63
125
  rdoc_options: []
64
126
  require_paths:
65
127
  - lib
66
128
  required_ruby_version: !ruby/object:Gem::Requirement
67
- none: false
68
129
  requirements:
69
- - - ! '>='
130
+ - - ">="
70
131
  - !ruby/object:Gem::Version
71
132
  version: '0'
72
133
  required_rubygems_version: !ruby/object:Gem::Requirement
73
- none: false
74
134
  requirements:
75
- - - ! '>='
135
+ - - ">="
76
136
  - !ruby/object:Gem::Version
77
137
  version: '0'
78
138
  requirements: []
79
139
  rubyforge_project: tcravit_ruby_lib
80
- rubygems_version: 1.8.10
140
+ rubygems_version: 2.7.4
81
141
  signing_key:
82
- specification_version: 3
142
+ specification_version: 4
83
143
  summary: Random reusable ruby stuff
84
- test_files:
85
- - spec/spec_helper.rb
86
- - spec/tcravit_ruby_lib/app_config_spec.rb
87
- - spec/tcravit_ruby_lib/config_searcher_spec.rb
88
- - spec/tcravit_ruby_lib/utility_spec.rb
144
+ test_files: []
data/CHANGELOG.md DELETED
@@ -1,3 +0,0 @@
1
- ## v 0.0.1 to 0.0.5, 2011-12-02
2
-
3
- * Initial release
@@ -1,49 +0,0 @@
1
- require 'spec_helper'
2
- require 'fileutils'
3
-
4
- describe "TcravitRubyLib::AppConfig" do
5
-
6
- STRING_VAL = "string"
7
- NUMERIC_VAL = 18293
8
- SYMBOLIC_VAL = :squid
9
-
10
- before(:all) do
11
- TcravitRubyLib::AppConfig.configure do
12
- string_value STRING_VAL
13
- numeric_value NUMERIC_VAL
14
- symbol_value SYMBOLIC_VAL
15
- end
16
- end
17
-
18
- it "should return the values for defined properties" do
19
- TcravitRubyLib::AppConfig.string_value.should == STRING_VAL
20
- TcravitRubyLib::AppConfig.numeric_value.should == NUMERIC_VAL
21
- TcravitRubyLib::AppConfig.symbol_value.should == SYMBOLIC_VAL
22
- end
23
-
24
- it "should raise an error for undefined properties" do
25
- lambda { TcravitRubyLib::AppConfig.fishpaste_value }.should raise_error
26
- end
27
-
28
- it "should allow me to change a configuration property" do
29
- TcravitRubyLib::AppConfig.string_value = "new value"
30
- TcravitRubyLib::AppConfig.string_value.should == "new value"
31
- end
32
-
33
- it "should allow me to remove a configuration property" do
34
- TcravitRubyLib::AppConfig.remove!(:string_value)
35
- lambda { TcravitRubyLib::AppConfig.string_value }.should raise_error
36
- end
37
-
38
- it "should allow additional properties to be added" do
39
- TcravitRubyLib::AppConfig.configure do
40
- another_value 192
41
- end
42
- TcravitRubyLib::AppConfig.configure do
43
- and_another_value 384
44
- end
45
- TcravitRubyLib::AppConfig.another_value.should == 192
46
- TcravitRubyLib::AppConfig.and_another_value.should == 384
47
- end
48
-
49
- end
@@ -1,54 +0,0 @@
1
- require 'spec_helper'
2
- require 'fileutils'
3
-
4
- describe "TcravitRubyLib::ConfigSearcher" do
5
-
6
- BASE_DIR = '/tmp/config_searcher_test'
7
- DEEP_DIR = "#{BASE_DIR}/foo/bar/baz"
8
- CONFIG_DIR = "#{BASE_DIR}/.config"
9
-
10
- before(:all) do
11
- FileUtils.mkdir_p DEEP_DIR
12
- FileUtils.mkdir_p CONFIG_DIR
13
- end
14
-
15
- after(:all) do
16
- FileUtils.remove_dir BASE_DIR, true
17
- end
18
-
19
- it "should successfully find a directory which exists" do
20
- dir_path = TcravitRubyLib::ConfigSearcher.locate_config_dir(start_in: DEEP_DIR, look_for: ".config")
21
- dir_path.to_s.should_not be_nil
22
- dir_path.to_s.should == CONFIG_DIR
23
- end
24
-
25
- it "should not find a directory when one doesn't exist" do
26
- dir_path = TcravitRubyLib::ConfigSearcher.locate_config_dir(start_in: DEEP_DIR, look_for: ".snausages")
27
- dir_path.to_s.should == ""
28
- end
29
-
30
- it "should return the container dir when the only_container_dir option is provided" do
31
- dir_path = TcravitRubyLib::ConfigSearcher.locate_config_dir(start_in: DEEP_DIR, look_for: ".config", only_container_dir: true)
32
- dir_path.to_s.should == BASE_DIR
33
- end
34
-
35
- it "should raise an exception when the start_in directory doesn't exist" do
36
- an_exception = nil
37
-
38
- begin
39
- dir_path = TcravitRubyLib::ConfigSearcher.locate_config_dir(start_in: "#{DEEP_DIR}xxxxxxx", look_for: ".snausages")
40
- rescue => e
41
- an_exception = e
42
- end
43
-
44
- an_exception.should_not be_nil
45
- an_exception.message.should == "No such file or directory - #{DEEP_DIR}xxxxxxx"
46
- end
47
-
48
- it "should behave the same for the alternative option names" do
49
- dir_path = TcravitRubyLib::ConfigSearcher.locate_config_dir(start_dir: DEEP_DIR, config_dir: ".config")
50
- dir_path.to_s.should_not be_nil
51
- dir_path.to_s.should == CONFIG_DIR
52
- end
53
-
54
- end
@@ -1,11 +0,0 @@
1
- require 'spec_helper'
2
- require "tcravit_ruby_lib/utility"
3
-
4
- describe "TcravitRubyLib::Utility" do
5
- it "random_alphanumeric() should return a random string of the correct length" do
6
- s = TcravitRubyLib::Utility.random_alphanumeric(16)
7
- s.should_not be_nil
8
- s.length.should == 16
9
- s.should match(/^[A-Za-z0-9]+$/)
10
- end
11
- end