prop 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +130 -34
- data/lib/prop.rb +2 -0
- data/prop.gemspec +73 -47
- metadata +47 -24
- data/.document +0 -5
- data/.gemtest +0 -0
- data/VERSION +0 -1
data/Rakefile
CHANGED
@@ -1,24 +1,50 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'rake'
|
3
|
+
require 'date'
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
5
|
+
#############################################################################
|
6
|
+
#
|
7
|
+
# Helper functions
|
8
|
+
#
|
9
|
+
#############################################################################
|
10
|
+
|
11
|
+
def name
|
12
|
+
@name ||= Dir['*.gemspec'].first.split('.').first
|
13
|
+
end
|
14
|
+
|
15
|
+
def version
|
16
|
+
line = File.read("lib/#{name}.rb")[/^\s*VERSION\s*=\s*.*/]
|
17
|
+
line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
|
18
|
+
end
|
19
|
+
|
20
|
+
def date
|
21
|
+
Date.today.to_s
|
20
22
|
end
|
21
23
|
|
24
|
+
def rubyforge_project
|
25
|
+
name
|
26
|
+
end
|
27
|
+
|
28
|
+
def gemspec_file
|
29
|
+
"#{name}.gemspec"
|
30
|
+
end
|
31
|
+
|
32
|
+
def gem_file
|
33
|
+
"#{name}-#{version}.gem"
|
34
|
+
end
|
35
|
+
|
36
|
+
def replace_header(head, header_name)
|
37
|
+
head.sub!(/(\.#{header_name}\s*= ').*'/) { "#{$1}#{send(header_name)}'"}
|
38
|
+
end
|
39
|
+
|
40
|
+
#############################################################################
|
41
|
+
#
|
42
|
+
# Standard tasks
|
43
|
+
#
|
44
|
+
#############################################################################
|
45
|
+
|
46
|
+
task :default => :test
|
47
|
+
|
22
48
|
require 'rake/testtask'
|
23
49
|
Rake::TestTask.new(:test) do |test|
|
24
50
|
test.libs << 'lib' << 'test'
|
@@ -26,29 +52,99 @@ Rake::TestTask.new(:test) do |test|
|
|
26
52
|
test.verbose = true
|
27
53
|
end
|
28
54
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
end
|
36
|
-
rescue LoadError
|
37
|
-
task :rcov do
|
38
|
-
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
39
|
-
end
|
55
|
+
desc "Generate RCov test coverage and open in your browser"
|
56
|
+
task :coverage do
|
57
|
+
require 'rcov'
|
58
|
+
sh "rm -fr coverage"
|
59
|
+
sh "rcov test/test_*.rb"
|
60
|
+
sh "open coverage/index.html"
|
40
61
|
end
|
41
62
|
|
42
|
-
task :test => :check_dependencies
|
43
|
-
|
44
|
-
task :default => :test
|
45
|
-
|
46
63
|
require 'rake/rdoctask'
|
47
64
|
Rake::RDocTask.new do |rdoc|
|
48
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
49
|
-
|
50
65
|
rdoc.rdoc_dir = 'rdoc'
|
51
|
-
rdoc.title = "
|
66
|
+
rdoc.title = "#{name} #{version}"
|
52
67
|
rdoc.rdoc_files.include('README*')
|
53
68
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
54
69
|
end
|
70
|
+
|
71
|
+
desc "Open an irb session preloaded with this library"
|
72
|
+
task :console do
|
73
|
+
sh "irb -rubygems -r ./lib/#{name}.rb"
|
74
|
+
end
|
75
|
+
|
76
|
+
#############################################################################
|
77
|
+
#
|
78
|
+
# Custom tasks (add your own tasks here)
|
79
|
+
#
|
80
|
+
#############################################################################
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
#############################################################################
|
85
|
+
#
|
86
|
+
# Packaging tasks
|
87
|
+
#
|
88
|
+
#############################################################################
|
89
|
+
|
90
|
+
desc "Create tag v#{version} and build and push #{gem_file} to Rubygems"
|
91
|
+
task :release => :build do
|
92
|
+
unless `git branch` =~ /^\* master$/
|
93
|
+
puts "You must be on the master branch to release!"
|
94
|
+
exit!
|
95
|
+
end
|
96
|
+
sh "git commit --allow-empty -a -m 'Release #{version}'"
|
97
|
+
sh "git tag v#{version}"
|
98
|
+
sh "git push origin master"
|
99
|
+
sh "git push origin v#{version}"
|
100
|
+
sh "gem push pkg/#{name}-#{version}.gem"
|
101
|
+
end
|
102
|
+
|
103
|
+
desc "Build #{gem_file} into the pkg directory"
|
104
|
+
task :build => :gemspec do
|
105
|
+
sh "mkdir -p pkg"
|
106
|
+
sh "gem build #{gemspec_file}"
|
107
|
+
sh "mv #{gem_file} pkg"
|
108
|
+
end
|
109
|
+
|
110
|
+
desc "Generate #{gemspec_file}"
|
111
|
+
task :gemspec => :validate do
|
112
|
+
# read spec file and split out manifest section
|
113
|
+
spec = File.read(gemspec_file)
|
114
|
+
head, manifest, tail = spec.split(" # = MANIFEST =\n")
|
115
|
+
|
116
|
+
# replace name version and date
|
117
|
+
replace_header(head, :name)
|
118
|
+
replace_header(head, :version)
|
119
|
+
replace_header(head, :date)
|
120
|
+
#comment this out if your rubyforge_project has a different name
|
121
|
+
replace_header(head, :rubyforge_project)
|
122
|
+
|
123
|
+
# determine file list from git ls-files
|
124
|
+
files = `git ls-files`.
|
125
|
+
split("\n").
|
126
|
+
sort.
|
127
|
+
reject { |file| file =~ /^\./ }.
|
128
|
+
reject { |file| file =~ /^(rdoc|pkg)/ }.
|
129
|
+
map { |file| " #{file}" }.
|
130
|
+
join("\n")
|
131
|
+
|
132
|
+
# piece file back together and write
|
133
|
+
manifest = " s.files = %w[\n#{files}\n ]\n"
|
134
|
+
spec = [head, manifest, tail].join(" # = MANIFEST =\n")
|
135
|
+
File.open(gemspec_file, 'w') { |io| io.write(spec) }
|
136
|
+
puts "Updated #{gemspec_file}"
|
137
|
+
end
|
138
|
+
|
139
|
+
desc "Validate #{gemspec_file}"
|
140
|
+
task :validate do
|
141
|
+
libfiles = Dir['lib/*'] - ["lib/#{name}.rb", "lib/#{name}"]
|
142
|
+
unless libfiles.empty?
|
143
|
+
puts "Directory `lib` should only contain a `#{name}.rb` file and `#{name}` dir."
|
144
|
+
exit!
|
145
|
+
end
|
146
|
+
unless Dir['VERSION*'].empty?
|
147
|
+
puts "A `VERSION` file at root level violates Gem best practices."
|
148
|
+
exit!
|
149
|
+
end
|
150
|
+
end
|
data/lib/prop.rb
CHANGED
data/prop.gemspec
CHANGED
@@ -1,51 +1,77 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
## This is the rakegem gemspec template. Make sure you read and understand
|
2
|
+
## all of the comments. Some sections require modification, and others can
|
3
|
+
## be deleted if you don't need them. Once you understand the contents of
|
4
|
+
## this file, feel free to delete any comments that begin with two hash marks.
|
5
|
+
## You can find comprehensive Gem::Specification documentation, at
|
6
|
+
## http://docs.rubygems.org/read/chapter/20
|
6
7
|
Gem::Specification.new do |s|
|
7
|
-
s.
|
8
|
-
s.version = "0.6.3"
|
9
|
-
|
8
|
+
s.specification_version = 2 if s.respond_to? :specification_version=
|
10
9
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
s.
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
10
|
+
s.rubygems_version = '1.3.5'
|
11
|
+
|
12
|
+
## Leave these as is they will be modified for you by the rake gemspec task.
|
13
|
+
## If your rubyforge_project name is different, then edit it and comment out
|
14
|
+
## the sub! line in the Rakefile
|
15
|
+
s.name = 'prop'
|
16
|
+
s.version = '0.6.4'
|
17
|
+
s.date = '2011-11-30'
|
18
|
+
s.rubyforge_project = 'prop'
|
19
|
+
|
20
|
+
## Make sure your summary is short. The description may be as long
|
21
|
+
## as you like.
|
22
|
+
s.summary = "Gem for implementing rate limits."
|
23
|
+
s.description = "Gem for implementing rate limits."
|
24
|
+
|
25
|
+
## List the primary authors. If there are a bunch of authors, it's probably
|
26
|
+
## better to set the email to an email list or something. If you don't have
|
27
|
+
## a custom homepage, consider using your GitHub URL or the like.
|
28
|
+
s.authors = ["Morten Primdahl"]
|
29
|
+
s.email = 'primdahl@me.com'
|
30
|
+
s.homepage = 'http://github.com/morten/prop'
|
31
|
+
|
32
|
+
## This gets added to the $LOAD_PATH so that 'lib/NAME.rb' can be required as
|
33
|
+
## require 'NAME.rb' or'/lib/NAME/file.rb' can be as require 'NAME/file.rb'
|
34
|
+
s.require_paths = %w[lib]
|
35
|
+
|
36
|
+
## This sections is only necessary if you have C extensions.
|
37
|
+
# s.require_paths << 'ext'
|
38
|
+
# s.extensions = %w[ext/extconf.rb]
|
39
|
+
|
40
|
+
## If your gem includes any executables, list them here.
|
41
|
+
# s.executables = ["name"]
|
42
|
+
|
43
|
+
## Specify any RDoc options here. You'll want to add your README and
|
44
|
+
## LICENSE files to the extra_rdoc_files list.
|
45
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
46
|
+
s.extra_rdoc_files = %w[README.rdoc LICENSE]
|
47
|
+
|
48
|
+
## List your runtime dependencies here. Runtime dependencies are those
|
49
|
+
## that are needed for an end user to actually USE your code.
|
50
|
+
# s.add_dependency('DEPNAME', [">= 1.1.0", "< 2.0.0"])
|
51
|
+
|
52
|
+
## List your development dependencies here. Development dependencies are
|
53
|
+
## those that are only needed during development
|
54
|
+
s.add_development_dependency('rake')
|
55
|
+
s.add_development_dependency('bundler')
|
56
|
+
s.add_development_dependency('shoulda')
|
57
|
+
s.add_development_dependency('mocha')
|
58
|
+
|
59
|
+
## Leave this section as-is. It will be automatically generated from the
|
60
|
+
## contents of your Git repository via the gemspec task. DO NOT REMOVE
|
61
|
+
## THE MANIFEST COMMENTS, they are used as delimiters by the task.
|
62
|
+
# = MANIFEST =
|
63
|
+
s.files = %w[
|
64
|
+
LICENSE
|
65
|
+
README.rdoc
|
66
|
+
Rakefile
|
67
|
+
lib/prop.rb
|
68
|
+
prop.gemspec
|
69
|
+
test/helper.rb
|
70
|
+
test/test_prop.rb
|
30
71
|
]
|
31
|
-
|
32
|
-
s.require_paths = ["lib"]
|
33
|
-
s.rubygems_version = %q{1.6.2}
|
34
|
-
s.summary = %q{Puts a cork in their requests}
|
35
|
-
|
36
|
-
if s.respond_to? :specification_version then
|
37
|
-
s.specification_version = 3
|
38
|
-
|
39
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
40
|
-
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
41
|
-
s.add_development_dependency(%q<mocha>, [">= 0.9.8"])
|
42
|
-
else
|
43
|
-
s.add_dependency(%q<shoulda>, [">= 0"])
|
44
|
-
s.add_dependency(%q<mocha>, [">= 0.9.8"])
|
45
|
-
end
|
46
|
-
else
|
47
|
-
s.add_dependency(%q<shoulda>, [">= 0"])
|
48
|
-
s.add_dependency(%q<mocha>, [">= 0.9.8"])
|
49
|
-
end
|
50
|
-
end
|
72
|
+
# = MANIFEST =
|
51
73
|
|
74
|
+
## Test files will be grabbed from the file list. Make sure the path glob
|
75
|
+
## matches what you actually use.
|
76
|
+
s.test_files = s.files.select { |path| path =~ /^test\/test_.*\.rb/ }
|
77
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 4
|
10
|
+
version: 0.6.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Morten Primdahl
|
@@ -15,11 +15,11 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-11-30 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
-
name:
|
22
|
+
name: rake
|
23
23
|
prerelease: false
|
24
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
@@ -33,37 +33,60 @@ dependencies:
|
|
33
33
|
type: :development
|
34
34
|
version_requirements: *id001
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
|
-
name:
|
36
|
+
name: bundler
|
37
37
|
prerelease: false
|
38
38
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
hash:
|
43
|
+
hash: 3
|
44
44
|
segments:
|
45
45
|
- 0
|
46
|
-
|
47
|
-
- 8
|
48
|
-
version: 0.9.8
|
46
|
+
version: "0"
|
49
47
|
type: :development
|
50
48
|
version_requirements: *id002
|
51
|
-
|
52
|
-
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: shoulda
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 3
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
version: "0"
|
61
|
+
type: :development
|
62
|
+
version_requirements: *id003
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: mocha
|
65
|
+
prerelease: false
|
66
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
hash: 3
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
version: "0"
|
75
|
+
type: :development
|
76
|
+
version_requirements: *id004
|
77
|
+
description: Gem for implementing rate limits.
|
78
|
+
email: primdahl@me.com
|
53
79
|
executables: []
|
54
80
|
|
55
81
|
extensions: []
|
56
82
|
|
57
83
|
extra_rdoc_files:
|
58
|
-
- LICENSE
|
59
84
|
- README.rdoc
|
85
|
+
- LICENSE
|
60
86
|
files:
|
61
|
-
- .document
|
62
|
-
- .gemtest
|
63
87
|
- LICENSE
|
64
88
|
- README.rdoc
|
65
89
|
- Rakefile
|
66
|
-
- VERSION
|
67
90
|
- lib/prop.rb
|
68
91
|
- prop.gemspec
|
69
92
|
- test/helper.rb
|
@@ -73,8 +96,8 @@ homepage: http://github.com/morten/prop
|
|
73
96
|
licenses: []
|
74
97
|
|
75
98
|
post_install_message:
|
76
|
-
rdoc_options:
|
77
|
-
|
99
|
+
rdoc_options:
|
100
|
+
- --charset=UTF-8
|
78
101
|
require_paths:
|
79
102
|
- lib
|
80
103
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -97,10 +120,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
120
|
version: "0"
|
98
121
|
requirements: []
|
99
122
|
|
100
|
-
rubyforge_project:
|
101
|
-
rubygems_version: 1.
|
123
|
+
rubyforge_project: prop
|
124
|
+
rubygems_version: 1.5.3
|
102
125
|
signing_key:
|
103
|
-
specification_version:
|
104
|
-
summary:
|
105
|
-
test_files:
|
106
|
-
|
126
|
+
specification_version: 2
|
127
|
+
summary: Gem for implementing rate limits.
|
128
|
+
test_files:
|
129
|
+
- test/test_prop.rb
|
data/.document
DELETED
data/.gemtest
DELETED
File without changes
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.6.3
|