qup 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,209 @@
1
+ require 'pathname'
2
+
3
+ # Public: A Class containing all the metadata and utilities needed to manage a
4
+ # ruby project.
5
+ class ThisProject
6
+ # The name of this project
7
+ attr_accessor :name
8
+
9
+ # The author's name
10
+ attr_accessor :author
11
+
12
+ # The email address of the author(s)
13
+ attr_accessor :email
14
+
15
+ # The homepage of this project
16
+ attr_accessor :homepage
17
+
18
+ # The regex of files to exclude from the manifest
19
+ attr_accessor :exclude_from_manifest
20
+
21
+ # The hash of Gem::Specifications keyed' by platform
22
+ attr_accessor :gemspecs
23
+
24
+ # Public: Initialize ThisProject
25
+ #
26
+ # Yields self
27
+ def initialize(&block)
28
+ @exclude_from_manifest = %r/\.(git|DS_Store)|^(doc|coverage|pkg|tmp|Gemfile(\.lock)?)|^[^\/]+\.gemspec|\.(swp|jar|bundle|so|rvmrc)$|~$/
29
+ @gemspecs = Hash.new
30
+ yield self if block_given?
31
+ end
32
+
33
+ # Public: return the version of ThisProject
34
+ #
35
+ # Search the ruby files in the project looking for the one that has the
36
+ # version string in it. This does not eval any code in the project, it parses
37
+ # the source code looking for the string.
38
+ #
39
+ # Returns a String version
40
+ def version
41
+ [ "lib/#{ name }.rb", "lib/#{ name }/version.rb" ].each do |v|
42
+ path = project_path( v )
43
+ line = path.read[/^\s*VERSION\s*=\s*.*/]
44
+ if line then
45
+ return line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
46
+ end
47
+ end
48
+ end
49
+
50
+ # Internal: Return a section of an RDoc file with the given section name
51
+ #
52
+ # path - the relative path in the project of the file to parse
53
+ # section_name - the section out of the file from which to parse data
54
+ #
55
+ # Retuns the text of the section as an array of paragrphs.
56
+ def section_of( file, section_name )
57
+ re = /^[=#]+ (.*)$/
58
+ sectional = project_path( file )
59
+ parts = sectional.read.split( re )[1..-1]
60
+ parts.map! { |p| p.strip }
61
+
62
+ sections = Hash.new
63
+ Hash[*parts].each do |k,v|
64
+ sections[k] = v.split("\n\n")
65
+ end
66
+ return sections[section_name]
67
+ end
68
+
69
+ # Internal: print out a warning about the give task
70
+ def task_warning( task )
71
+ warn "WARNING: '#{task}' tasks are not defined. Please run 'rake develop'"
72
+ end
73
+
74
+ # Internal: Return the full path to the file that is relative to the project
75
+ # root.
76
+ #
77
+ # path - the relative path of the file from the project root
78
+ #
79
+ # Returns the Pathname of the file
80
+ def project_path( *relative_path )
81
+ project_root.join( *relative_path )
82
+ end
83
+
84
+ # Internal: The absolute path of this file
85
+ #
86
+ # Returns the Pathname of this file.
87
+ def this_file_path
88
+ Pathname.new( __FILE__ ).expand_path
89
+ end
90
+
91
+ # Internal: The root directory of this project
92
+ #
93
+ # This is defined as being the directory that is in the path of this project
94
+ # that has the first Rakefile
95
+ #
96
+ # Returns the Pathname of the directory
97
+ def project_root
98
+ this_file_path.ascend do |p|
99
+ rakefile = p.join( 'Rakefile' )
100
+ return p if rakefile.exist?
101
+ end
102
+ end
103
+
104
+ # Internal: Returns the contents of the Manifest.txt file as an array
105
+ #
106
+ # Returns an Array of strings
107
+ def manifest
108
+ manifest_file = project_path( "Manifest.txt" )
109
+ abort "You need a Manifest.txt" unless manifest_file.readable?
110
+ manifest_file.readlines.map { |l| l.strip }
111
+ end
112
+
113
+ # Internal: Return the files that define the extensions
114
+ #
115
+ # Returns an Array
116
+ def extension_conf_files
117
+ manifest.grep( /extconf.rb\Z/ )
118
+ end
119
+
120
+ # Internal: Returns the gemspace associated with the current ruby platform
121
+ def platform_gemspec
122
+ gemspecs[platform]
123
+ end
124
+
125
+ def core_gemspec
126
+ Gem::Specification.new do |spec|
127
+ spec.name = name
128
+ spec.version = version
129
+ spec.author = author
130
+ spec.email = email
131
+ spec.homepage = homepage
132
+
133
+ spec.summary = summary
134
+ spec.description = description
135
+
136
+ spec.files = manifest
137
+ spec.executables = spec.files.grep(/^bin/) { |f| File.basename(f) }
138
+ spec.test_files = spec.files.grep(/^spec/)
139
+
140
+ spec.extra_rdoc_files += spec.files.grep(/(txt|rdoc|md)$/)
141
+ spec.rdoc_options = [ "--main" , 'README.md',
142
+ "--markup", "tomdoc" ]
143
+ end
144
+ end
145
+
146
+ # Internal: Return the gemspec for the ruby platform
147
+ def ruby_gemspec( core = core_gemspec, &block )
148
+ yielding_gemspec( 'ruby', core, &block )
149
+ end
150
+
151
+ # Internal: Return the gemspec for the jruby platform
152
+ def java_gemspec( core = core_gemspec, &block )
153
+ yielding_gemspec( 'java', core, &block )
154
+ end
155
+
156
+ # Internal: give an initial spec and a key, create a new gemspec based off of
157
+ # it.
158
+ #
159
+ # This will force the new gemspecs 'platform' to be that of the key, since the
160
+ # only reason you would have multiple gemspecs at this point is to deal with
161
+ # different platforms.
162
+ def yielding_gemspec( key, core )
163
+ spec = gemspecs[key] ||= core.dup
164
+ spec.platform = key
165
+ yield spec if block_given?
166
+ return spec
167
+ end
168
+
169
+ # Internal: Set the recovery gem development dependency
170
+ #
171
+ # These are dynamically set since they cannot be hard coded as there is
172
+ # no way to ship them correctly in the gemspec
173
+ #
174
+ # Returns nothing.
175
+ def set_coverage_gem
176
+ if RUBY_VERSION < "1.9.0"
177
+ platform_gemspec.add_development_dependency( 'rcov', '~> 1.0.0' )
178
+ else
179
+ platform_gemspec.add_development_dependency( 'simplecov', '~> 0.8.2' )
180
+ end
181
+ end
182
+
183
+ # Internal: Return the platform of ThisProject at the current moment in time.
184
+ def platform
185
+ (RUBY_PLATFORM == "java") ? 'java' : Gem::Platform::RUBY
186
+ end
187
+
188
+ # Internal: Return the DESCRIPTION section of the README.rdoc file
189
+ def description_section
190
+ section_of( 'README.md', 'DESCRIPTION')
191
+ end
192
+
193
+ # Internal: Return the summary text from the README
194
+ def summary
195
+ description_section.first
196
+ end
197
+
198
+ # Internal: Return the full description text from the READEM
199
+ def description
200
+ description_section.join(" ").tr("\n", ' ').gsub(/[{}]/,'').gsub(/\[[^\]]+\]/,'') # strip rdoc
201
+ end
202
+
203
+ # Internal: The path to the gemspec file
204
+ def gemspec_file
205
+ project_path( "#{ name }.gemspec" )
206
+ end
207
+ end
208
+
209
+ This = ThisProject.new
metadata CHANGED
@@ -1,136 +1,123 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: qup
3
- version: !ruby/object:Gem::Version
4
- hash: 7
5
- prerelease:
6
- segments:
7
- - 1
8
- - 4
9
- - 0
10
- version: 1.4.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.4.1
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Jeremy Hinegardner
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2012-10-31 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
11
+ date: 2013-12-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
21
14
  name: maildir
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
26
17
  - - ~>
27
- - !ruby/object:Gem::Version
28
- hash: 11
29
- segments:
30
- - 2
31
- - 1
32
- - 0
18
+ - !ruby/object:Gem::Version
33
19
  version: 2.1.0
34
20
  type: :runtime
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: kjess
38
21
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
40
- none: false
41
- requirements:
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 2.1.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: kjess
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
42
31
  - - ~>
43
- - !ruby/object:Gem::Version
44
- hash: 23
45
- segments:
46
- - 1
47
- - 0
48
- - 0
49
- version: 1.0.0
32
+ - !ruby/object:Gem::Version
33
+ version: '1.2'
50
34
  type: :development
51
- version_requirements: *id002
52
- - !ruby/object:Gem::Dependency
53
- name: redis
54
35
  prerelease: false
55
- requirement: &id003 !ruby/object:Gem::Requirement
56
- none: false
57
- requirements:
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.2'
41
+ - !ruby/object:Gem::Dependency
42
+ name: redis
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
58
45
  - - ~>
59
- - !ruby/object:Gem::Version
60
- hash: 3
61
- segments:
62
- - 3
63
- - 0
64
- - 2
65
- version: 3.0.2
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
66
48
  type: :development
67
- version_requirements: *id003
68
- - !ruby/object:Gem::Dependency
69
- name: rake
70
49
  prerelease: false
71
- requirement: &id004 !ruby/object:Gem::Requirement
72
- none: false
73
- requirements:
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
74
52
  - - ~>
75
- - !ruby/object:Gem::Version
76
- hash: 11
77
- segments:
78
- - 0
79
- - 9
80
- - 2
81
- - 2
82
- version: 0.9.2.2
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 10.1.0
83
62
  type: :development
84
- version_requirements: *id004
85
- - !ruby/object:Gem::Dependency
86
- name: rspec
87
63
  prerelease: false
88
- requirement: &id005 !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
91
66
  - - ~>
92
- - !ruby/object:Gem::Version
93
- hash: 35
94
- segments:
95
- - 2
96
- - 11
97
- - 0
98
- version: 2.11.0
67
+ - !ruby/object:Gem::Version
68
+ version: 10.1.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: 2.14.0
99
76
  type: :development
100
- version_requirements: *id005
101
- - !ruby/object:Gem::Dependency
102
- name: rdoc
103
77
  prerelease: false
104
- requirement: &id006 !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
107
80
  - - ~>
108
- - !ruby/object:Gem::Version
109
- hash: 31
110
- segments:
111
- - 3
112
- - 12
113
- version: "3.12"
81
+ - !ruby/object:Gem::Version
82
+ version: 2.14.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: rdoc
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: '4.0'
114
90
  type: :development
115
- version_requirements: *id006
116
- description: Qup is a generalized API for Message Queue and Publish/Subscribe messaging patterns with the ability to plug in an appropriate messaging infrastructure based upon your needs. Qup ships with support for Kestrel, Redis, and a filesystem infrastructure based on Maildir. Additional Adapters will be developed as needs arise. Please submit an Issue to have a new Adapter created. Pull requests gladly accepted.
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: '4.0'
97
+ description: Qup is a generalized API for Message Queue and Publish/Subscribe messaging
98
+ patterns with the ability to plug in an appropriate messaging infrastructure based
99
+ upon your needs. Qup ships with support for (https://github.com/robey/kestrel),
100
+ (http://redis.io), and a filesystem infrastructure based on (https://rubygems.org/gems/maildir).
101
+ Additional Adapters will be developed as needs arise. (https://github.com/copiousfreetime/qup/issues)
102
+ to have a new Adapter created. Pull requests gladly accepted.
117
103
  email: jeremy@copiousfreetime.org
118
104
  executables: []
119
-
120
105
  extensions: []
121
-
122
- extra_rdoc_files:
123
- - ADAPTER_API.rdoc
124
- - HISTORY.rdoc
106
+ extra_rdoc_files:
107
+ - ADAPTER_API.md
108
+ - CONTRIBUTING.md
109
+ - HISTORY.md
125
110
  - Manifest.txt
126
- - README.rdoc
127
- files:
111
+ - README.md
112
+ files:
128
113
  - .autotest
129
114
  - .gemtest
130
- - ADAPTER_API.rdoc
131
- - HISTORY.rdoc
115
+ - ADAPTER_API.md
116
+ - CONTRIBUTING.md
117
+ - HISTORY.md
118
+ - LICENSE
132
119
  - Manifest.txt
133
- - README.rdoc
120
+ - README.md
134
121
  - Rakefile
135
122
  - lib/qup.rb
136
123
  - lib/qup/adapter.rb
@@ -181,43 +168,38 @@ files:
181
168
  - spec/qup/topic_api_spec.rb
182
169
  - spec/qup_spec.rb
183
170
  - spec/spec_helper.rb
171
+ - tasks/default.rake
172
+ - tasks/this.rb
184
173
  homepage: http://github.com/copiousfreetime/qup
185
174
  licenses: []
186
-
175
+ metadata: {}
187
176
  post_install_message:
188
- rdoc_options:
177
+ rdoc_options:
189
178
  - --main
190
- - README.rdoc
179
+ - README.md
191
180
  - --markup
192
181
  - tomdoc
193
- require_paths:
182
+ require_paths:
194
183
  - lib
195
- required_ruby_version: !ruby/object:Gem::Requirement
196
- none: false
197
- requirements:
198
- - - ">="
199
- - !ruby/object:Gem::Version
200
- hash: 3
201
- segments:
202
- - 0
203
- version: "0"
204
- required_rubygems_version: !ruby/object:Gem::Requirement
205
- none: false
206
- requirements:
207
- - - ">="
208
- - !ruby/object:Gem::Version
209
- hash: 3
210
- segments:
211
- - 0
212
- version: "0"
184
+ required_ruby_version: !ruby/object:Gem::Requirement
185
+ requirements:
186
+ - - ! '>='
187
+ - !ruby/object:Gem::Version
188
+ version: '0'
189
+ required_rubygems_version: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - ! '>='
192
+ - !ruby/object:Gem::Version
193
+ version: '0'
213
194
  requirements: []
214
-
215
195
  rubyforge_project:
216
- rubygems_version: 1.8.24
196
+ rubygems_version: 2.1.11
217
197
  signing_key:
218
- specification_version: 3
219
- summary: Qup is a generalized API for Message Queue and Publish/Subscribe messaging patterns with the ability to plug in an appropriate messaging infrastructure based upon your needs.
220
- test_files:
198
+ specification_version: 4
199
+ summary: Qup is a generalized API for Message Queue and Publish/Subscribe messaging
200
+ patterns with the ability to plug in an appropriate messaging infrastructure based
201
+ upon your needs.
202
+ test_files:
221
203
  - spec/qup/adapter/kestrel/queue_spec.rb
222
204
  - spec/qup/adapter/kestrel/topic_spec.rb
223
205
  - spec/qup/adapter/kestrel_context.rb