p2ruby 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +27 -0
- data/HISTORY +7 -0
- data/LICENSE +20 -0
- data/README.rdoc +24 -0
- data/Rakefile +42 -0
- data/VERSION +1 -0
- data/bin/olegen.rb +368 -0
- data/features/p2ruby.feature +9 -0
- data/features/step_definitions/p2ruby_steps.rb +0 -0
- data/features/support/env.rb +10 -0
- data/features/support/world.rb +12 -0
- data/lib/extension.rb +19 -0
- data/lib/ole20110223-013209.rb +1677 -0
- data/lib/p2ruby/application.rb +111 -0
- data/lib/p2ruby/base.rb +59 -0
- data/lib/p2ruby/connection.rb +250 -0
- data/lib/p2ruby/data_stream.rb +215 -0
- data/lib/p2ruby/library.rb +24 -0
- data/lib/p2ruby/message.rb +150 -0
- data/lib/p2ruby/message_factory.rb +70 -0
- data/lib/p2ruby/record.rb +104 -0
- data/lib/p2ruby/router.rb +45 -0
- data/lib/p2ruby/table_set.rb +166 -0
- data/lib/p2ruby.rb +156 -0
- data/lib/version.rb +8 -0
- data/lib/win32ole-pr.rb +5540 -0
- data/spec/encoding_spec.rb +15 -0
- data/spec/p2ruby/application_spec.rb +35 -0
- data/spec/p2ruby/connection_spec.rb +293 -0
- data/spec/p2ruby/data_stream_spec.rb +218 -0
- data/spec/p2ruby/library_spec.rb +42 -0
- data/spec/p2ruby/message_factory_spec.rb +69 -0
- data/spec/p2ruby/message_spec.rb +159 -0
- data/spec/p2ruby/record_spec.rb +85 -0
- data/spec/p2ruby/router_spec.rb +54 -0
- data/spec/p2ruby/table_set_spec.rb +132 -0
- data/spec/p2ruby_spec.rb +46 -0
- data/spec/spec_helper.rb +78 -0
- data/tasks/common.rake +18 -0
- data/tasks/doc.rake +14 -0
- data/tasks/gem.rake +40 -0
- data/tasks/git.rake +34 -0
- data/tasks/spec.rake +16 -0
- data/tasks/version.rake +71 -0
- metadata +149 -0
data/tasks/version.rake
ADDED
@@ -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(CLASS_NAME::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
ADDED
@@ -0,0 +1,149 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: p2ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.1.0
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- arvicco
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-03-19 00:00:00 +03:00
|
14
|
+
default_executable:
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: rspec
|
18
|
+
prerelease: false
|
19
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
|
+
none: false
|
21
|
+
requirements:
|
22
|
+
- - ">="
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: 2.0.0
|
25
|
+
type: :development
|
26
|
+
version_requirements: *id001
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: cucumber
|
29
|
+
prerelease: false
|
30
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
31
|
+
none: false
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: "0"
|
36
|
+
type: :development
|
37
|
+
version_requirements: *id002
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: bundler
|
40
|
+
prerelease: false
|
41
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 1.0.0
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: *id003
|
49
|
+
description: Ruby bindings and wrapper classes for P2ClientGate
|
50
|
+
email: arvitallian@gmail.com
|
51
|
+
executables:
|
52
|
+
- olegen.rb
|
53
|
+
extensions: []
|
54
|
+
|
55
|
+
extra_rdoc_files:
|
56
|
+
- LICENSE
|
57
|
+
- HISTORY
|
58
|
+
- README.rdoc
|
59
|
+
files:
|
60
|
+
- bin/olegen.rb
|
61
|
+
- lib/extension.rb
|
62
|
+
- lib/ole20110223-013209.rb
|
63
|
+
- lib/p2ruby/application.rb
|
64
|
+
- lib/p2ruby/base.rb
|
65
|
+
- lib/p2ruby/connection.rb
|
66
|
+
- lib/p2ruby/data_stream.rb
|
67
|
+
- lib/p2ruby/library.rb
|
68
|
+
- lib/p2ruby/message.rb
|
69
|
+
- lib/p2ruby/message_factory.rb
|
70
|
+
- lib/p2ruby/record.rb
|
71
|
+
- lib/p2ruby/router.rb
|
72
|
+
- lib/p2ruby/table_set.rb
|
73
|
+
- lib/p2ruby.rb
|
74
|
+
- lib/version.rb
|
75
|
+
- lib/win32ole-pr.rb
|
76
|
+
- spec/encoding_spec.rb
|
77
|
+
- spec/p2ruby/application_spec.rb
|
78
|
+
- spec/p2ruby/connection_spec.rb
|
79
|
+
- spec/p2ruby/data_stream_spec.rb
|
80
|
+
- spec/p2ruby/library_spec.rb
|
81
|
+
- spec/p2ruby/message_factory_spec.rb
|
82
|
+
- spec/p2ruby/message_spec.rb
|
83
|
+
- spec/p2ruby/record_spec.rb
|
84
|
+
- spec/p2ruby/router_spec.rb
|
85
|
+
- spec/p2ruby/table_set_spec.rb
|
86
|
+
- spec/p2ruby_spec.rb
|
87
|
+
- spec/spec_helper.rb
|
88
|
+
- features/p2ruby.feature
|
89
|
+
- features/step_definitions/p2ruby_steps.rb
|
90
|
+
- features/support/env.rb
|
91
|
+
- features/support/world.rb
|
92
|
+
- tasks/common.rake
|
93
|
+
- tasks/doc.rake
|
94
|
+
- tasks/gem.rake
|
95
|
+
- tasks/git.rake
|
96
|
+
- tasks/spec.rake
|
97
|
+
- tasks/version.rake
|
98
|
+
- Rakefile
|
99
|
+
- README.rdoc
|
100
|
+
- LICENSE
|
101
|
+
- VERSION
|
102
|
+
- HISTORY
|
103
|
+
- .gitignore
|
104
|
+
has_rdoc: true
|
105
|
+
homepage: http://github.com/arvicco/p2ruby
|
106
|
+
licenses: []
|
107
|
+
|
108
|
+
post_install_message:
|
109
|
+
rdoc_options:
|
110
|
+
- --charset
|
111
|
+
- UTF-8
|
112
|
+
- --main
|
113
|
+
- README.rdoc
|
114
|
+
- --title
|
115
|
+
- p2ruby
|
116
|
+
require_paths:
|
117
|
+
- lib
|
118
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
119
|
+
none: false
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: "0"
|
124
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
|
+
none: false
|
126
|
+
requirements:
|
127
|
+
- - ">="
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: "0"
|
130
|
+
requirements: []
|
131
|
+
|
132
|
+
rubyforge_project:
|
133
|
+
rubygems_version: 1.5.0
|
134
|
+
signing_key:
|
135
|
+
specification_version: 3
|
136
|
+
summary: Ruby bindings for P2ClientGate
|
137
|
+
test_files:
|
138
|
+
- spec/encoding_spec.rb
|
139
|
+
- spec/p2ruby/application_spec.rb
|
140
|
+
- spec/p2ruby/connection_spec.rb
|
141
|
+
- spec/p2ruby/data_stream_spec.rb
|
142
|
+
- spec/p2ruby/library_spec.rb
|
143
|
+
- spec/p2ruby/message_factory_spec.rb
|
144
|
+
- spec/p2ruby/message_spec.rb
|
145
|
+
- spec/p2ruby/record_spec.rb
|
146
|
+
- spec/p2ruby/router_spec.rb
|
147
|
+
- spec/p2ruby/table_set_spec.rb
|
148
|
+
- spec/p2ruby_spec.rb
|
149
|
+
- spec/spec_helper.rb
|