inventory 1.1.3 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +3 -3
- data/lib/inventory-1.0.rb +1 -1
- data/lib/inventory/version.rb +2 -11
- metadata +17 -16
- data/lib/inventory/rake/tasks-1.0.rb +0 -26
- data/lib/inventory/rake/tasks/check.rb +0 -4
- data/lib/inventory/rake/tasks/clean.rb +0 -35
- data/lib/inventory/rake/tasks/gem.rb +0 -191
- data/lib/inventory/rake/tasks/inventory.rb +0 -27
- data/test/unit/inventory/rake/tasks-1.0.rb +0 -4
- data/test/unit/inventory/rake/tasks/check.rb +0 -4
- data/test/unit/inventory/rake/tasks/clean.rb +0 -4
- data/test/unit/inventory/rake/tasks/gem.rb +0 -4
- data/test/unit/inventory/rake/tasks/inventory.rb +0 -4
data/Rakefile
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
|
3
|
-
require 'lookout/rake/tasks-3.0'
|
4
|
-
|
5
3
|
$:.unshift File.expand_path('../lib', __FILE__)
|
6
|
-
require 'inventory/rake/tasks-1.0'
|
7
4
|
require 'inventory-1.0'
|
8
5
|
|
6
|
+
require 'inventory/rake-1.0'
|
7
|
+
require 'lookout/rake-3.0'
|
8
|
+
|
9
9
|
Inventory::Rake::Tasks.define Inventory::Version, :gem => proc{ |_, s|
|
10
10
|
s.author = 'Nikolai Weibull'
|
11
11
|
s.email = 'now@bitwi.se'
|
data/lib/inventory-1.0.rb
CHANGED
@@ -8,7 +8,7 @@ class Inventory
|
|
8
8
|
raise ArgumentError, 'default value of path argument could not be calculated' unless path
|
9
9
|
@path = path
|
10
10
|
@srcdir, _, @package_path = File.dirname(File.expand_path(path)).rpartition('/lib/')
|
11
|
-
@package_require = '%s-%d.0' % [
|
11
|
+
@package_require = '%s-%d.0' % [package_path, major]
|
12
12
|
raise ArgumentError,
|
13
13
|
'path is not of the form PATH/lib/PACKAGE/version.rb: %s' % path if
|
14
14
|
@srcdir.empty?
|
data/lib/inventory/version.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
|
3
3
|
class Inventory
|
4
|
-
Version = Inventory.new(1,
|
4
|
+
Version = Inventory.new(1, 2, 2){
|
5
5
|
def dependencies
|
6
6
|
Dependencies.new{
|
7
7
|
development 'lookout', 3, 0, 0
|
8
|
+
development 'lookout-rake', 3, 0, 0
|
8
9
|
development 'yard', 0, 7, 0
|
9
10
|
}
|
10
11
|
end
|
@@ -18,15 +19,5 @@ class Inventory
|
|
18
19
|
inventory/dependencies/runtime.rb
|
19
20
|
'
|
20
21
|
end
|
21
|
-
|
22
|
-
def additional_libs
|
23
|
-
super + %w'
|
24
|
-
inventory/rake/tasks-1.0.rb
|
25
|
-
inventory/rake/tasks/check.rb
|
26
|
-
inventory/rake/tasks/clean.rb
|
27
|
-
inventory/rake/tasks/gem.rb
|
28
|
-
inventory/rake/tasks/inventory.rb
|
29
|
-
'
|
30
|
-
end
|
31
22
|
}
|
32
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inventory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-
|
12
|
+
date: 2012-04-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: lookout
|
16
|
-
requirement: &
|
16
|
+
requirement: &15170700 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,21 @@ dependencies:
|
|
21
21
|
version: '3.0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *15170700
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: lookout-rake
|
27
|
+
requirement: &15169428 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '3.0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *15169428
|
25
36
|
- !ruby/object:Gem::Dependency
|
26
37
|
name: yard
|
27
|
-
requirement: &
|
38
|
+
requirement: &15168468 !ruby/object:Gem::Requirement
|
28
39
|
none: false
|
29
40
|
requirements:
|
30
41
|
- - ~>
|
@@ -32,7 +43,7 @@ dependencies:
|
|
32
43
|
version: 0.7.0
|
33
44
|
type: :development
|
34
45
|
prerelease: false
|
35
|
-
version_requirements: *
|
46
|
+
version_requirements: *15168468
|
36
47
|
description: ! " Inventory\n\n Inventory allows
|
37
48
|
you to create inventories of your Ruby projects. These\n inventories can then
|
38
49
|
be used to load the project, create gem specifications\n and gems, run unit tests,
|
@@ -49,11 +60,6 @@ files:
|
|
49
60
|
- lib/inventory/dependencies/runtime.rb
|
50
61
|
- lib/inventory-1.0.rb
|
51
62
|
- lib/inventory/version.rb
|
52
|
-
- lib/inventory/rake/tasks-1.0.rb
|
53
|
-
- lib/inventory/rake/tasks/check.rb
|
54
|
-
- lib/inventory/rake/tasks/clean.rb
|
55
|
-
- lib/inventory/rake/tasks/gem.rb
|
56
|
-
- lib/inventory/rake/tasks/inventory.rb
|
57
63
|
- test/unit/inventory/dependency.rb
|
58
64
|
- test/unit/inventory/dependencies.rb
|
59
65
|
- test/unit/inventory/dependencies/development.rb
|
@@ -61,11 +67,6 @@ files:
|
|
61
67
|
- test/unit/inventory/dependencies/runtime.rb
|
62
68
|
- test/unit/inventory-1.0.rb
|
63
69
|
- test/unit/inventory/version.rb
|
64
|
-
- test/unit/inventory/rake/tasks-1.0.rb
|
65
|
-
- test/unit/inventory/rake/tasks/check.rb
|
66
|
-
- test/unit/inventory/rake/tasks/clean.rb
|
67
|
-
- test/unit/inventory/rake/tasks/gem.rb
|
68
|
-
- test/unit/inventory/rake/tasks/inventory.rb
|
69
70
|
- README
|
70
71
|
- Rakefile
|
71
72
|
homepage: https://github.com/now/inventory
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
require 'rake'
|
4
|
-
|
5
|
-
class Inventory; module Rake end end
|
6
|
-
|
7
|
-
module Inventory::Rake::Tasks
|
8
|
-
%w'check clean gem inventory'.each do |file|
|
9
|
-
load File.expand_path('../tasks/%s.rb' % file, __FILE__)
|
10
|
-
end
|
11
|
-
|
12
|
-
@mostlycleanfiles, @cleanfiles, @distcleanfiles = [], [], []
|
13
|
-
|
14
|
-
class << self
|
15
|
-
attr_accessor :inventory
|
16
|
-
|
17
|
-
attr_reader :mostlycleanfiles, :cleanfiles, :distcleanfiles
|
18
|
-
|
19
|
-
def define(inventory, options = {})
|
20
|
-
self.inventory = inventory
|
21
|
-
Clean.define
|
22
|
-
Inventory.new(:inventory => inventory)
|
23
|
-
Gem.new(:inventory => inventory, &(options.fetch(:gem, proc{ })))
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
class Inventory::Rake::Tasks::Clean
|
4
|
-
include Rake::DSL
|
5
|
-
|
6
|
-
class << self
|
7
|
-
include Rake::DSL
|
8
|
-
|
9
|
-
def define
|
10
|
-
desc 'Delete targets built by rake that are often rebuilt'
|
11
|
-
new :mostlyclean, Inventory::Rake::Tasks.mostlycleanfiles
|
12
|
-
|
13
|
-
desc 'Delete targets built by rake'
|
14
|
-
new :clean, Inventory::Rake::Tasks.cleanfiles
|
15
|
-
task :clean => :mostlyclean
|
16
|
-
|
17
|
-
desc 'Delete targets built by extconf.rb'
|
18
|
-
new :distclean, Inventory::Rake::Tasks.distcleanfiles
|
19
|
-
task :distclean => :clean
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def initialize(name, files = [])
|
24
|
-
@name, @files = name, files
|
25
|
-
define
|
26
|
-
end
|
27
|
-
|
28
|
-
def define
|
29
|
-
task name do
|
30
|
-
rm files, :force => true
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
attr_accessor :name, :files
|
35
|
-
end
|
@@ -1,191 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
class Inventory::Rake::Tasks::Gem
|
4
|
-
include Rake::DSL
|
5
|
-
|
6
|
-
def initialize(options = {})
|
7
|
-
self.inventory = options.fetch(:inventory, Inventory::Rake::Tasks.inventory)
|
8
|
-
self.specification = options.fetch(:specification,
|
9
|
-
Gem::Specification.new{ |s|
|
10
|
-
next unless @inventory
|
11
|
-
|
12
|
-
s.name = @inventory.package
|
13
|
-
s.version = @inventory.to_s # TODO: We could probably skip #to_s
|
14
|
-
|
15
|
-
s.description = IO.read('README')
|
16
|
-
s.summary = s.description[/^.*?\./].lstrip
|
17
|
-
|
18
|
-
s.files = @inventory.files # TODO: We can skip #files and rely on #to_a
|
19
|
-
|
20
|
-
s.require_paths = @inventory.lib_directories
|
21
|
-
|
22
|
-
@inventory.dependencies.add_to_gem_specification s
|
23
|
-
})
|
24
|
-
yield self, @specification if block_given?
|
25
|
-
define
|
26
|
-
end
|
27
|
-
|
28
|
-
def define
|
29
|
-
desc 'Create specifications' unless Rake::Task.task_defined? :spec
|
30
|
-
task :spec => :'gem:spec'
|
31
|
-
|
32
|
-
gemspec = '%s.gemspec' % @specification.name
|
33
|
-
Inventory::Rake::Tasks.cleanfiles << gemspec
|
34
|
-
|
35
|
-
desc 'Create gem specification' unless Rake::Task.task_defined? :'gem:spec'
|
36
|
-
task :'gem:spec' => gemspec
|
37
|
-
|
38
|
-
file gemspec => %w'Rakefile README' + [@inventory.path] do |t|
|
39
|
-
tmp = '%s.tmp' % t.name
|
40
|
-
rm([t.name, tmp], :force => true)
|
41
|
-
rake_output_message 'gem specification --ruby %s > %s' %
|
42
|
-
[@specification.name, tmp] if verbose
|
43
|
-
File.open(tmp, 'wb') do |f|
|
44
|
-
f.write @specification.to_ruby
|
45
|
-
end
|
46
|
-
chmod File.stat(tmp).mode & ~0222, tmp
|
47
|
-
mv tmp, t.name
|
48
|
-
end
|
49
|
-
|
50
|
-
desc 'Create files for distribution' unless Rake::Task.task_defined? :dist
|
51
|
-
task :dist => :'gem:dist'
|
52
|
-
|
53
|
-
desc 'Create %s for distribution' % @specification.file_name
|
54
|
-
task :'gem:dist' => [:'inventory:check', @specification.file_name]
|
55
|
-
file @specification.file_name => @specification.files do
|
56
|
-
require 'rubygems' unless defined? Gem
|
57
|
-
rake_output_message 'gem build %s' % gemspec if verbose
|
58
|
-
Gem::Builder.new(@specification).build
|
59
|
-
end
|
60
|
-
|
61
|
-
desc 'Check files before distribution' unless
|
62
|
-
Rake::Task.task_defined? :'dist:check'
|
63
|
-
task :'dist:check' => [:dist, :'gem:dist:check']
|
64
|
-
|
65
|
-
desc 'Check %s before distribution' % @specification.file_name
|
66
|
-
task :'gem:dist:check' => :'gem:dist' do
|
67
|
-
require 'rubygems' unless defined? Gem
|
68
|
-
require 'rubygems/installer' unless defined? Gem::Installer
|
69
|
-
checkdir = @specification.full_name
|
70
|
-
rake_output_message 'gem unpack %s --target %s' %
|
71
|
-
[@specification.file_name, checkdir] if verbose
|
72
|
-
Gem::Installer.new(@specification.file_name, :unpack => true).
|
73
|
-
unpack File.expand_path(checkdir)
|
74
|
-
chdir checkdir do
|
75
|
-
sh '%s %sinventory:check check' %
|
76
|
-
[Rake.application.name, Rake.application.options.silent ? '-s ' : '']
|
77
|
-
end
|
78
|
-
rm_r checkdir
|
79
|
-
end
|
80
|
-
|
81
|
-
desc 'Install dependencies on the local system' unless
|
82
|
-
Rake::Task.task_defined? :'deps:install'
|
83
|
-
task :'deps:install' => :'gem:deps:install'
|
84
|
-
|
85
|
-
desc 'Install dependencies in ruby gem directory'
|
86
|
-
task :'gem:deps:install' do
|
87
|
-
require 'rubygems' unless defined? Gem
|
88
|
-
require 'rubygems/dependency_installer' unless defined? Gem::DependencyInstaller
|
89
|
-
@specification.dependencies.each do |dependency|
|
90
|
-
rake_output_message "gem install %s -v '%s'" % [dependency.name, dependency.requirement] if verbose
|
91
|
-
Gem::DependencyInstaller.new.install dependency.name, dependency.requirement
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
desc 'Install dependencies for the current user' unless
|
96
|
-
Rake::Task.task_defined? :'deps:install:user'
|
97
|
-
task :'deps:install:user' => :'gem:deps:install:user'
|
98
|
-
|
99
|
-
desc 'Install dependencies for the current user'
|
100
|
-
task :'gem:deps:install:user' do
|
101
|
-
require 'rubygems' unless defined? Gem
|
102
|
-
require 'rubygems/dependency_installer' unless defined? Gem::DependencyInstaller
|
103
|
-
@specification.dependencies.each do |dependency|
|
104
|
-
rake_output_message "gem install --user-install --bindir %s %s -v '%s'" %
|
105
|
-
[Gem.bindir(Gem.user_dir), dependency.name, dependency.requirement] if verbose
|
106
|
-
Gem::DependencyInstaller.
|
107
|
-
new(:user_install => true,
|
108
|
-
:bindir => Gem.bindir(Gem.user_dir)).
|
109
|
-
install dependency.name, dependency.requirement
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
desc 'Install distribution files on the local system' unless
|
114
|
-
Rake::Task.task_defined? :install
|
115
|
-
task :install => :'gem:install'
|
116
|
-
|
117
|
-
desc 'Install %s in ruby gem directory' %
|
118
|
-
@specification.file_name
|
119
|
-
task :'gem:install' => :'gem:dist' do |t|
|
120
|
-
require 'rubygems' unless defined? Gem
|
121
|
-
require 'rubygems/dependency_installer' unless defined? Gem::DependencyInstaller
|
122
|
-
rake_output_message 'gem install %s' % @specification.file_name if verbose
|
123
|
-
Gem::DependencyInstaller.
|
124
|
-
new(:ignore_dependencies => true).
|
125
|
-
install @specification.file_name
|
126
|
-
end
|
127
|
-
|
128
|
-
desc 'Install distribution files for the current user' unless
|
129
|
-
Rake::Task.task_defined? :'install:user'
|
130
|
-
task :'install:user' => :'gem:install:user'
|
131
|
-
|
132
|
-
desc 'Install %s in user gem directory' %
|
133
|
-
@specification.file_name
|
134
|
-
task :'gem:install:user' => :'gem:dist' do
|
135
|
-
require 'rubygems' unless defined? Gem
|
136
|
-
require 'rubygems/dependency_installer' unless defined? Gem::DependencyInstaller
|
137
|
-
rake_output_message 'gem install --user-install --bindir %s %s' %
|
138
|
-
[Gem.bindir(Gem.user_dir), @specification.file_name] if verbose
|
139
|
-
Gem::DependencyInstaller.
|
140
|
-
new(:ignore_dependencies => true,
|
141
|
-
:user_install => true,
|
142
|
-
:bindir => Gem.bindir(Gem.user_dir)).
|
143
|
-
install @specification.file_name
|
144
|
-
end
|
145
|
-
|
146
|
-
desc 'Delete all files installed on the local system' unless
|
147
|
-
Rake::Task.task_defined? :uninstall
|
148
|
-
task :uninstall => :'gem:uninstall'
|
149
|
-
|
150
|
-
desc 'Uninstall %s from ruby gem directory' % @specification.file_name
|
151
|
-
task :'gem:uninstall' do
|
152
|
-
require 'rubygems' unless defined? Gem
|
153
|
-
# TODO: I have absolutely no idea why this is needed, but it is.
|
154
|
-
require 'rubygems/user_interaction' unless defined? Gem::UserInteraction
|
155
|
-
require 'rubygems/uninstaller' unless defined? Gem::Uninstaller
|
156
|
-
rake_output_message 'gem uninstall --executables %s' % @specification.name if verbose
|
157
|
-
Gem::Uninstaller.new(@specification.name,
|
158
|
-
:executables => true,
|
159
|
-
:version => @specification.version).uninstall
|
160
|
-
end
|
161
|
-
|
162
|
-
desc 'Delete all files installed for current user' unless
|
163
|
-
Rake::Task.task_defined? :'uninstall:user'
|
164
|
-
task :'uninstall:user' => :'gem:uninstall:user'
|
165
|
-
|
166
|
-
desc 'Uninstall %s from user gem directory' % @specification.file_name
|
167
|
-
task :'gem:uninstall:user' do
|
168
|
-
require 'rubygems' unless defined? Gem
|
169
|
-
# TODO: I have absolutely no idea why this is needed, but it is.
|
170
|
-
require 'rubygems/user_interaction' unless defined? Gem::UserInteraction
|
171
|
-
require 'rubygems/uninstaller' unless defined? Gem::Uninstaller
|
172
|
-
rake_output_message 'gem uninstall --executables --install-dir %s %s' %
|
173
|
-
[Gem.user_dir, @specification.name] if verbose
|
174
|
-
Gem::Uninstaller.new(@specification.name,
|
175
|
-
:executables => true,
|
176
|
-
:install_dir => Gem.user_dir,
|
177
|
-
:version => @specification.version).uninstall
|
178
|
-
end
|
179
|
-
|
180
|
-
desc 'Push distribution files to distribution hubs' unless
|
181
|
-
Rake::Task.task_defined? :push
|
182
|
-
task :push => :'gem:push'
|
183
|
-
|
184
|
-
desc 'Push %s to rubygems.org' % @specification.file_name
|
185
|
-
task :'gem:push' => :'gem:dist:check' do
|
186
|
-
sh 'gem push -%s-verbose %s' % [verbose ? '' : '-no', @specification.file_name]
|
187
|
-
end
|
188
|
-
end
|
189
|
-
|
190
|
-
attr_writer :inventory, :specification
|
191
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
class Inventory::Rake::Tasks::Inventory
|
4
|
-
include Rake::DSL
|
5
|
-
|
6
|
-
def initialize(options = {})
|
7
|
-
self.inventory = options.fetch(:inventory, Inventory::Rake::Tasks.inventory)
|
8
|
-
yield self if block_given?
|
9
|
-
define
|
10
|
-
end
|
11
|
-
|
12
|
-
def define
|
13
|
-
desc 'Check that the inventory is correct'
|
14
|
-
task :'inventory:check' do
|
15
|
-
# TODO: Use directories from Inventory instead of hard-coding lib and
|
16
|
-
# test/unit. We want to check ext too?
|
17
|
-
diff = ((Dir['{lib,test/unit}/**/*.rb'] -
|
18
|
-
@inventory.lib_files -
|
19
|
-
@inventory.unit_test_files).map{ |e| 'file not listed in inventory: %s' % e } +
|
20
|
-
@inventory.files.reject{ |e| File.exist? e }.map{ |e| 'file listed in inventory does not exist: %s' % e })
|
21
|
-
fail diff.join("\n") unless diff.empty?
|
22
|
-
# TODO: puts 'inventory checks out' if verbose
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
attr_writer :inventory
|
27
|
-
end
|