arvicco-amqp 0.6.8 → 0.6.9

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.
data/tasks/spec.rake ADDED
@@ -0,0 +1,15 @@
1
+ desc 'Alias to spec:spec'
2
+ task :spec => 'spec:spec'
3
+
4
+ namespace :spec do
5
+ require 'rspec/core/rake_task'
6
+
7
+ desc "Run all specs"
8
+ RSpec::Core::RakeTask.new(:spec){|task|}
9
+
10
+ desc "Run specs with RCov"
11
+ RSpec::Core::RakeTask.new(:rcov) do |t|
12
+ t.rcov = true
13
+ t.rcov_opts = ['--exclude', 'spec']
14
+ end
15
+ end
@@ -0,0 +1,71 @@
1
+ class Version
2
+ attr_accessor :major, :minor, :patch, :build
3
+
4
+ def initialize(version_string)
5
+ raise "Invalid version #{version_string}" unless version_string =~ /^(\d+)\.(\d+)\.(\d+)(?:\.(.*?))?$/
6
+ @major = $1.to_i
7
+ @minor = $2.to_i
8
+ @patch = $3.to_i
9
+ @build = $4
10
+ end
11
+
12
+ def bump_major(x)
13
+ @major += x.to_i
14
+ @minor = 0
15
+ @patch = 0
16
+ @build = nil
17
+ end
18
+
19
+ def bump_minor(x)
20
+ @minor += x.to_i
21
+ @patch = 0
22
+ @build = nil
23
+ end
24
+
25
+ def bump_patch(x)
26
+ @patch += x.to_i
27
+ @build = nil
28
+ end
29
+
30
+ def update(major, minor, patch, build=nil)
31
+ @major = major
32
+ @minor = minor
33
+ @patch = patch
34
+ @build = build
35
+ end
36
+
37
+ def write(desc = nil)
38
+ CLASS_NAME::VERSION_FILE.open('w') {|file| file.puts to_s }
39
+ (BASE_PATH + 'HISTORY').open('a') do |file|
40
+ file.puts "\n== #{to_s} / #{Time.now.strftime '%Y-%m-%d'}\n"
41
+ file.puts "\n* #{desc}\n" if desc
42
+ end
43
+ end
44
+
45
+ def to_s
46
+ [major, minor, patch, build].compact.join('.')
47
+ end
48
+ end
49
+
50
+ desc 'Set version: [x.y.z] - explicitly, [1/10/100] - bump major/minor/patch, [.build] - build'
51
+ task :version, [:command, :desc] do |t, args|
52
+ version = Version.new(VERSION)
53
+ case args.command
54
+ when /^(\d+)\.(\d+)\.(\d+)(?:\.(.*?))?$/ # Set version explicitly
55
+ version.update($1, $2, $3, $4)
56
+ when /^\.(.*?)$/ # Set build
57
+ version.build = $1
58
+ when /^(\d{1})$/ # Bump patch
59
+ version.bump_patch $1
60
+ when /^(\d{1})0$/ # Bump minor
61
+ version.bump_minor $1
62
+ when /^(\d{1})00$/ # Bump major
63
+ version.bump_major $1
64
+ else # Unknown command, just display VERSION
65
+ puts "#{NAME} #{version}"
66
+ next
67
+ end
68
+
69
+ puts "Writing version #{version} to VERSION file"
70
+ version.write args.desc
71
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arvicco-amqp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 8
10
- version: 0.6.8
9
+ - 9
10
+ version: 0.6.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Aman Gupta
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-11-03 00:00:00 +03:00
19
+ date: 2010-11-04 00:00:00 +03:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -68,12 +68,6 @@ extra_rdoc_files:
68
68
  - doc/EXAMPLE_05_POP
69
69
  - doc/EXAMPLE_06_HASHTABLE
70
70
  files:
71
- - Rakefile
72
- - README.md
73
- - VERSION
74
- - TODO
75
- - HISTORY
76
- - .gitignore
77
71
  - doc/EXAMPLE_01_PINGPONG
78
72
  - doc/EXAMPLE_02_CLOCK
79
73
  - doc/EXAMPLE_03_STOCKS
@@ -81,6 +75,49 @@ files:
81
75
  - doc/EXAMPLE_05_ACK
82
76
  - doc/EXAMPLE_05_POP
83
77
  - doc/EXAMPLE_06_HASHTABLE
78
+ - lib/amqp/buffer.rb
79
+ - lib/amqp/client.rb
80
+ - lib/amqp/frame.rb
81
+ - lib/amqp/protocol.rb
82
+ - lib/amqp/server.rb
83
+ - lib/amqp/spec.rb
84
+ - lib/amqp/version.rb
85
+ - lib/amqp.rb
86
+ - lib/ext/blankslate.rb
87
+ - lib/ext/em.rb
88
+ - lib/ext/emfork.rb
89
+ - lib/mq/exchange.rb
90
+ - lib/mq/header.rb
91
+ - lib/mq/logger.rb
92
+ - lib/mq/queue.rb
93
+ - lib/mq/rpc.rb
94
+ - lib/mq.rb
95
+ - old/amqp-0.8.json
96
+ - old/amqp_spec.rb
97
+ - old/amqpc.rb
98
+ - old/codegen.rb
99
+ - old/Rakefile
100
+ - old/README
101
+ - protocol/amqp-0.8.json
102
+ - protocol/amqp-0.8.xml
103
+ - protocol/codegen.rb
104
+ - protocol/doc.txt
105
+ - research/api.rb
106
+ - research/primes-forked.rb
107
+ - research/primes-processes.rb
108
+ - research/primes-threaded.rb
109
+ - tasks/common.rake
110
+ - tasks/doc.rake
111
+ - tasks/gem.rake
112
+ - tasks/git.rake
113
+ - tasks/spec.rake
114
+ - tasks/version.rake
115
+ - Rakefile
116
+ - README.md
117
+ - VERSION
118
+ - TODO
119
+ - HISTORY
120
+ - .gitignore
84
121
  has_rdoc: true
85
122
  homepage: http://github.com/arvicco/amqp
86
123
  licenses: []