kit 1.1.4 → 1.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71eebf88223124964a39a9482927e16fc288c93e
4
- data.tar.gz: 046b976cfb399fca534c563021442dbd1940d575
3
+ metadata.gz: fa63580261b3d227196443e0b2d763520134e414
4
+ data.tar.gz: 89ab5125fa16b0d654185a22a0c4f8e9a1cf1b3d
5
5
  SHA512:
6
- metadata.gz: fdfa8db3f37f35a2b2382ad68d0077e09ab6966b429ac30fb8a60b9be4624a093062d238450c77341eaef235383792c77195094123f0858a68423f9d91239e25
7
- data.tar.gz: c9e9bd4279ac0ece44bed4125842f1cd38d376a9ff1e740ad0ec38bb25779d57eaa8214076cf3cd7b06d0f020132ad13a45a9147ce6a32ae67e54eadd9f78fd0
6
+ metadata.gz: 337a95d654576f544ac8d995c62faab66343edbba21230aba6d842d0c06ac1922c07adf5d472db748a2ebac49fcc92bd8a4aa63704f02e53fc4744e1dd1481f3
7
+ data.tar.gz: 10449ce40ba35e84620899c8d0a05645e4a3182cef38a3c9c6524b4a0e8fc59f120121d29d0531e8e406aea7d6f20f01bfdace60ff793633612d8e3417d45bda
data/.gitignore CHANGED
@@ -16,4 +16,4 @@ spec/reports
16
16
  test/tmp
17
17
  test/version_tmp
18
18
  tmp
19
- test_kit/
19
+ test-kit/
data/.yardopts CHANGED
@@ -1,2 +1,2 @@
1
1
  --exclude spec/
2
- --exclude test_kit/
2
+ --exclude test-kit/
@@ -1,26 +1,30 @@
1
1
  = Kit ChangeLog
2
2
 
3
- == 1.1.0
3
+ Only releases with user facing changes and development improvements noted.
4
+ See commit log for full detail.
4
5
 
5
- === Breaking changes
6
+ == 1.2.0
6
7
 
7
- +KitActionsDefault+ now extends all +Kit::Bit+ instances instead of only those without a group.
8
+ - Gem requirements now use pessimistic versioning.
9
+ - Guard::RSpec Guardfile.
8
10
 
9
- == 1.0.0
11
+ == 1.1.3
10
12
 
11
- === Breaking changes
13
+ - Support for Kate project plugin (development).
12
14
 
13
- Kit has been completely rewritten using Active Record.
14
- See the {README}[http://rubydoc.info/gems/kit/frames] and {wiki}[https://github.com/razor-x/kit/wiki] for new documentation.
15
+ == 1.1.1
15
16
 
16
- == 0.3.0
17
+ - Added bump rake tasks.
18
+
19
+ == 1.1.0
17
20
 
18
21
  === Breaking changes
19
22
 
20
- * Kits are now expected to have an actions.rb file and specific global action files in the actions directory.
21
- This allows one to write methods available to all actions and methods available to specific actions (helps with DRY).
22
- See the skeleton kit for the updated structure.
23
+ - +KitActionsDefault+ now extends all +Kit::Bit+ instances instead of only those without a group.
24
+
25
+ == 1.0.0
23
26
 
24
- === Enhancements
27
+ === Breaking changes
25
28
 
26
- * Added changelog.
29
+ - Kit has been completely rewritten using Active Record.
30
+ - See the {README}[http://rubydoc.info/gems/kit/frames] and {wiki}[https://github.com/razor-x/kit/wiki] for new documentation.
@@ -0,0 +1,5 @@
1
+ guard :rspec do
2
+ watch(%r{^spec/.+_spec\.rb$})
3
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
4
+ watch('spec/spec_helper.rb') { 'spec' }
5
+ end
@@ -103,7 +103,7 @@ After cloning, you can run +yard+ to generate documentation for the source
103
103
  $ cd kit
104
104
  $ yard
105
105
 
106
- You will also need to set up the test_kit to run specs. Do this with
106
+ You will also need to set up the test-kit to run specs. Do this with
107
107
 
108
108
  $ rake develop:prepare
109
109
 
data/Rakefile CHANGED
@@ -5,17 +5,23 @@ require 'git'
5
5
 
6
6
  namespace 'develop' do
7
7
 
8
- test_kit = File.expand_path '../test_kit', __FILE__
8
+ test_kit = File.expand_path '../test-kit', __FILE__
9
9
 
10
+ desc 'Clones the skeleton kit to test-kit for unit testing.'
10
11
  task :prepare do |t|
11
- puts 'Test kit exists, no need to clone it.' if File.exists? test_kit
12
- Git.clone 'git://github.com/razor-x/skeleton-kit.git', test_kit unless File.exists? test_kit
12
+ if File.exists? test_kit
13
+ puts 'Test kit exists, no need to clone it.'
14
+ else
15
+ Git.clone 'git://github.com/razor-x/skeleton-kit.git', test_kit
16
+ end
13
17
  end
14
18
 
19
+ desc 'Updates the test-kit with git pull'
15
20
  task :update => [ :prepare ] do |t|
16
21
  Git.open(test_kit).pull
17
22
  end
18
23
 
24
+ desc 'Hard reset the test-kit to the last commit'
19
25
  task :reset => [ :prepare, :update ] do |t|
20
26
  Git.open(test_kit).reset_hard('master')
21
27
  end
@@ -17,12 +17,12 @@ Gem::Specification.new do |gem|
17
17
  gem.platform = Gem::Platform::RUBY
18
18
  gem.version = Kit::VERSION
19
19
 
20
- gem.add_dependency 'activerecord'
21
- gem.add_dependency 'rake'
22
-
23
- gem.add_development_dependency 'sqlite3'
24
- gem.add_development_dependency 'rspec'
25
- gem.add_development_dependency 'git'
26
- gem.add_development_dependency 'bump'
20
+ gem.add_dependency 'activerecord', '~> 4.0.0'
21
+ gem.add_dependency 'rake', '~> 10.1.0'
27
22
 
23
+ gem.add_development_dependency 'sqlite3', '~> 1.3.8'
24
+ gem.add_development_dependency 'git', '~> 1.2.6'
25
+ gem.add_development_dependency 'rspec', '~> 2.14.1'
26
+ gem.add_development_dependency 'guard-rspec', '~> 3.0.3'
27
+ gem.add_development_dependency 'bump', '~> 0.4.2'
28
28
  end
@@ -1,3 +1,12 @@
1
1
  require 'kit/rake/admin/database'
2
2
  require 'kit/rake/admin/manage'
3
3
  require 'kit/rake/admin/make'
4
+
5
+ def make_class_template file_name, class_line
6
+ unless File.exists? file_name
7
+ f = File.new file_name, 'w+'
8
+ f << class_line
9
+ f << "\nend"
10
+ f.close
11
+ end
12
+ end
@@ -2,14 +2,17 @@ namespace 'db' do
2
2
 
3
3
  kit = Kit.new 'config.yml'
4
4
 
5
+ desc %q{Create the kit's database}
5
6
  task :create do
6
7
  kit.db_create
7
8
  end
8
9
 
10
+ desc %q{Destroy the kit's database}
9
11
  task :destroy do
10
12
  kit.db_destroy
11
13
  end
12
14
 
15
+ desc %q{Reset the kit's database to an empty state and run all migrations}
13
16
  task :reset => [:destroy, :create, :migrate] do
14
17
  end
15
18
 
@@ -17,6 +20,7 @@ namespace 'db' do
17
20
  kit.db_connect
18
21
  end
19
22
 
23
+ desc %q{Fully migrate the kit's database: optionally specify the direction and how many steps (1 by default)}
20
24
  task :migrate, [:direction, :steps] => [:create, :environment] do |_, args|
21
25
  args.with_defaults(direction: nil, steps: 1)
22
26
  if args[:direction].nil?
@@ -1,18 +1,11 @@
1
1
  namespace 'mk' do
2
2
 
3
- def make_class_template file_name, class_line
4
- unless File.exists? file_name
5
- f = File.new file_name, 'w+'
6
- f << class_line
7
- f << "\nend"
8
- f.close
9
- end
10
- end
11
-
3
+ desc 'Create a new migration at migrations/YYYYMMDDHHMMSS_name.rb'
12
4
  task :migration, :name do |_, args|
13
5
  make_class_template "migrations/#{Time.now.utc.strftime('%Y%m%d%H%M%S')}_#{args[:name]}.rb", "class #{args[:name].camelize} < ActiveRecord::Migration"
14
6
  end
15
7
 
8
+ desc 'Create a new model at models/name.rb'
16
9
  task :model, :name do |_, args|
17
10
  make_class_template "models/#{args[:name]}.rb", "class Kit::#{args[:name].camelize} < ActiveRecord::Base"
18
11
  end
@@ -1,5 +1,6 @@
1
1
  namespace 'add' do
2
2
 
3
+ desc 'Add a new group named "name" and create an action module actions/name.rb'
3
4
  task :group, :name do |_, args|
4
5
  kit = Kit.open 'config.yml'
5
6
  Kit::Group.create :name => args[:name].gsub('_', ' ')
@@ -1,4 +1,4 @@
1
1
  class Kit
2
2
  # Version number.
3
- VERSION = '1.1.4'
3
+ VERSION = '1.2.0'
4
4
  end
@@ -3,7 +3,7 @@ require 'kit'
3
3
  describe Kit::Bit do
4
4
 
5
5
  before :all do
6
- @config_file = File.expand_path '../../test_kit/config.yml', __FILE__
6
+ @config_file = File.expand_path '../../test-kit/config.yml', __FILE__
7
7
  Kit.new(@config_file).db_create.db_connect.db_migrate
8
8
  end
9
9
 
@@ -23,7 +23,7 @@ describe Kit::Bit do
23
23
 
24
24
  context "given #{type}" do
25
25
 
26
- config = File.expand_path '../../test_kit/config.yml', __FILE__
26
+ config = File.expand_path '../../test-kit/config.yml', __FILE__
27
27
  if type == :args
28
28
  subject { Kit::Bit::Job.new config, 1, :the_action, :arg_1, :arg_2 }
29
29
  else
@@ -32,7 +32,7 @@ describe Kit::Bit do
32
32
  end
33
33
 
34
34
  before :each do
35
- @bit = mock('Kit::Bit', :id => 1, :the_action => nil)
35
+ @bit = double('Kit::Bit', :id => 1, :the_action => nil)
36
36
  Kit::Bit.stub(:find).and_return(@bit)
37
37
  end
38
38
 
@@ -37,7 +37,7 @@ describe KitDBSupport do
37
37
 
38
38
  it "does not raise error if sqlite3 database file exists" do
39
39
  File.stub(:exists?).with(@sqlite3[:database]).and_return(true)
40
- expect { KitDBSupport::create @config[:sqlite3] }.to_not raise_error RuntimeError, /exists/
40
+ expect { KitDBSupport::create @config[:sqlite3] }.to_not raise_error
41
41
  end
42
42
  end
43
43
 
@@ -57,7 +57,7 @@ describe KitDBSupport do
57
57
 
58
58
  it "raises error if sqlite3 database file does not exist" do
59
59
  File.stub(:exists?).with(@sqlite3[:database]).and_return(false)
60
- expect { KitDBSupport::destroy! @config[:sqlite3] }.to raise_error RuntimeError, /does not exist/
60
+ expect { KitDBSupport::destroy! @config[:sqlite3] }.to raise_exception RuntimeError, /does not exist/
61
61
  end
62
62
  end
63
63
  end
@@ -70,7 +70,7 @@ describe KitDBSupport do
70
70
 
71
71
  it "does not raise error if sqlite3 database file does not exist" do
72
72
  File.stub(:exists?).with(@sqlite3[:database]).and_return(false)
73
- expect { KitDBSupport::destroy @config[:sqlite3] }.to_not raise_error RuntimeError, /does not exist/
73
+ expect { KitDBSupport::destroy @config[:sqlite3] }.to_not raise_exception
74
74
  end
75
75
  end
76
76
 
@@ -3,8 +3,8 @@ require 'kit'
3
3
  describe Kit do
4
4
 
5
5
  before :all do
6
- @kit_path = File.expand_path '../../test_kit', __FILE__
7
- @config_file = File.expand_path '../../test_kit/config.yml', __FILE__
6
+ @kit_path = File.expand_path '../../test-kit', __FILE__
7
+ @config_file = File.expand_path '../../test-kit/config.yml', __FILE__
8
8
  @config = YAML.load File.read("#{@kit_path}/config.yml")
9
9
  end
10
10
 
metadata CHANGED
@@ -1,99 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Boyd Sosenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-12 00:00:00.000000000 Z
11
+ date: 2013-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 4.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 4.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 10.1.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 10.1.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: sqlite3
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 1.3.8
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 1.3.8
55
+ - !ruby/object:Gem::Dependency
56
+ name: git
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 1.2.6
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 1.2.6
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rspec
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - '>='
73
+ - - ~>
60
74
  - !ruby/object:Gem::Version
61
- version: '0'
75
+ version: 2.14.1
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - '>='
80
+ - - ~>
67
81
  - !ruby/object:Gem::Version
68
- version: '0'
82
+ version: 2.14.1
69
83
  - !ruby/object:Gem::Dependency
70
- name: git
84
+ name: guard-rspec
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
- - - '>='
87
+ - - ~>
74
88
  - !ruby/object:Gem::Version
75
- version: '0'
89
+ version: 3.0.3
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
- - - '>='
94
+ - - ~>
81
95
  - !ruby/object:Gem::Version
82
- version: '0'
96
+ version: 3.0.3
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: bump
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
- - - '>='
101
+ - - ~>
88
102
  - !ruby/object:Gem::Version
89
- version: '0'
103
+ version: 0.4.2
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
- - - '>='
108
+ - - ~>
95
109
  - !ruby/object:Gem::Version
96
- version: '0'
110
+ version: 0.4.2
97
111
  description: Kit is a framework for making simple management tools called kits.
98
112
  email:
99
113
  - razorx@evansosenko.com
@@ -107,6 +121,7 @@ files:
107
121
  - .yardopts
108
122
  - CHANGELOG.rdoc
109
123
  - Gemfile
124
+ - Guardfile
110
125
  - LICENSE.txt
111
126
  - README.rdoc
112
127
  - Rakefile
@@ -145,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
160
  version: '0'
146
161
  requirements: []
147
162
  rubyforge_project:
148
- rubygems_version: 2.0.0
163
+ rubygems_version: 2.0.3
149
164
  signing_key:
150
165
  specification_version: 4
151
166
  summary: Write your shell scripts in beautiful Ruby, put them in a kit, and keep them