timewizard 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/Rakefile +4 -4
- data/lib/timewizard/version.rb +1 -1
- data/lib/timewizard/versioner/cordova.rb +99 -0
- data/resources/cordova/config.xml +11 -0
- metadata +35 -32
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MWQ4NmM2ZTZiNTQ3NWM4YWZlN2YzNTdkNTFjNTBhMjNmYzMwMmE4Mw==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 04d3d38e661c0942e045ef80122d2cae13ac69c6
|
4
|
+
data.tar.gz: 01de9db223ac0e5feb81eb9921d893928b31cb9d
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
Y2RlYWVjMTYwNDJhMmZjNGYwMDk2MGQzMGM4MWNhOTVjZTBhZGMyNzhiYjg4
|
11
|
-
ZjUwYzM5MWY4MjE4MGJiZmI5YWViOGZmYmNmZjFkOGU1OWZiNDA=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
YzFkZTE2NDRkYjI0MzUxOTc5NTJmZTIwMTJkZGI2Zjk3OWQyM2Y4MDBmNTBi
|
14
|
-
ZWUyOWQ2NzBiZWFkMjljMzZiOTQyZmI0ZTgzYzQ5ZjdiNWFkNzg4NzQwYjBj
|
15
|
-
YjM0NDJmYjU3ODdlMTYyN2MyN2UxNDNkYWM5MWQyYjg5YTZjMjQ=
|
6
|
+
metadata.gz: a51a9d9b5d9253d9603d8b1d5193886cda8e162400654e99dde535f028e77a7181f9647c751e92496091a50d0b0f31125ce1a61092ba62534dde9917740cc446
|
7
|
+
data.tar.gz: a5fa24a7c0be34c13528ec0a49634e364d8be6ac3a273bc3a53b41933a321f9401d2cc631bb6c6d724ac2891f07cdcd1cce34bc987b6d78197222ef35c908bc1
|
data/Rakefile
CHANGED
@@ -6,7 +6,7 @@ begin
|
|
6
6
|
require 'bundler'
|
7
7
|
rescue LoadError => e
|
8
8
|
warn e.message
|
9
|
-
warn
|
9
|
+
warn 'Run `gem install bundler` to install Bundler.'
|
10
10
|
exit -1
|
11
11
|
end
|
12
12
|
|
@@ -14,20 +14,20 @@ begin
|
|
14
14
|
Bundler.setup(:development)
|
15
15
|
rescue Bundler::BundlerError => e
|
16
16
|
warn e.message
|
17
|
-
warn
|
17
|
+
warn 'Run `bundle install` to install missing gems.'
|
18
18
|
exit e.status_code
|
19
19
|
end
|
20
20
|
|
21
21
|
require 'rake'
|
22
22
|
|
23
|
-
desc
|
23
|
+
desc 'Removes the tmp and pkg directories'
|
24
24
|
task :clean do
|
25
25
|
pwd = Dir.pwd.to_s
|
26
26
|
FileUtils.rm_rf Dir["#{pwd}/tmp"]
|
27
27
|
FileUtils.rm_rf Dir["#{pwd}/pkg"]
|
28
28
|
end
|
29
29
|
|
30
|
-
desc
|
30
|
+
desc 'Copies resource files to the tmp directory (for testing purposes)'
|
31
31
|
task :prepare do
|
32
32
|
pwd = Dir.pwd.to_s
|
33
33
|
FileUtils.cp_r("#{pwd}/resources/.", "#{pwd}/tmp")
|
data/lib/timewizard/version.rb
CHANGED
@@ -0,0 +1,99 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
require 'timewizard/versioner'
|
3
|
+
|
4
|
+
module Timewizard
|
5
|
+
module Versioner
|
6
|
+
# Represents the Worklight implementation of the versioner spec.
|
7
|
+
# @author Richard Harrah
|
8
|
+
# @since 0.1.0
|
9
|
+
class Cordova < Timewizard::Versioner::Base
|
10
|
+
|
11
|
+
#
|
12
|
+
# Public functions (inherited from parent)
|
13
|
+
#
|
14
|
+
public
|
15
|
+
|
16
|
+
def initialize(path_to_file)
|
17
|
+
super path_to_file
|
18
|
+
@file_contents = ''
|
19
|
+
end
|
20
|
+
|
21
|
+
#
|
22
|
+
# Private functions (implementation specific)
|
23
|
+
#
|
24
|
+
private
|
25
|
+
|
26
|
+
SPACE_REGEX = /\s+/
|
27
|
+
|
28
|
+
def read_file
|
29
|
+
if @file.nil?
|
30
|
+
raise 'file is nil and cannot be read'
|
31
|
+
end
|
32
|
+
|
33
|
+
@file_contents = Nokogiri.XML('')
|
34
|
+
|
35
|
+
if File.exist?(@file)
|
36
|
+
@file_contents = File.open(@file, 'r+') { |f| Nokogiri.XML(f) }
|
37
|
+
end
|
38
|
+
|
39
|
+
@file_contents
|
40
|
+
end
|
41
|
+
|
42
|
+
def write_file
|
43
|
+
if @file.nil?
|
44
|
+
raise 'file is nil and cannot be written'
|
45
|
+
end
|
46
|
+
if @file_contents.nil?
|
47
|
+
raise 'file_contents is null and cannot be written'
|
48
|
+
end
|
49
|
+
File.open(@file, 'w') { |f| @file_contents.write_xml_to(f) }
|
50
|
+
end
|
51
|
+
|
52
|
+
def find_build_and_version_numbers
|
53
|
+
if @file_contents.nil?
|
54
|
+
read_file
|
55
|
+
end
|
56
|
+
|
57
|
+
widget = @file_contents.at_css('widget')
|
58
|
+
|
59
|
+
widget_version_num = widget['version']
|
60
|
+
|
61
|
+
parsed_version_num = Versionomy.parse(widget_version_num,
|
62
|
+
Versionomy::Format.get('rubygems'))
|
63
|
+
|
64
|
+
@bumped_version_number = parsed_version_num.bump(parsed_version_num.parts.length - 1)
|
65
|
+
|
66
|
+
obn = parsed_version_num.unparse
|
67
|
+
ovn = parsed_version_num.unparse
|
68
|
+
nbn = parsed_version_num.bump(parsed_version_num.parts.length - 1).unparse
|
69
|
+
nvn = ovn
|
70
|
+
|
71
|
+
[obn, ovn, nbn, nvn]
|
72
|
+
end
|
73
|
+
|
74
|
+
def change_build_numbers
|
75
|
+
if @file_contents.nil?
|
76
|
+
read_file
|
77
|
+
end
|
78
|
+
if @new_build_number.nil?
|
79
|
+
read_build_numbers
|
80
|
+
end
|
81
|
+
# don't actually want to do anything for build numbers for worklight
|
82
|
+
nil
|
83
|
+
end
|
84
|
+
|
85
|
+
def change_version_numbers
|
86
|
+
if @file_contents.nil?
|
87
|
+
read_file
|
88
|
+
end
|
89
|
+
if @new_version_number.nil?
|
90
|
+
read_version_numbers
|
91
|
+
end
|
92
|
+
widget = @file_contents.at_css('widget')
|
93
|
+
|
94
|
+
widget['version'] = @new_version_number.to_s
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<widget id="com.example.hello" version="0.0.1">
|
2
|
+
<name>HelloWorld</name>
|
3
|
+
<description>
|
4
|
+
A sample Apache Cordova application that responds to the deviceready event.
|
5
|
+
</description>
|
6
|
+
<author email="dev@callback.apache.org" href="http://cordova.io">
|
7
|
+
Apache Cordova Team
|
8
|
+
</author>
|
9
|
+
<content src="index.html"/>
|
10
|
+
<access origin="*"/>
|
11
|
+
</widget>
|
metadata
CHANGED
@@ -1,153 +1,153 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timewizard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Harrah
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: CFPropertyList
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '2.3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: nokogiri
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 1.6.6
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 1.6.6
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: versionomy
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0.4'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.4'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '1.10'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.10'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '10.0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - ~>
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '10.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - ~>
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '3.3'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - ~>
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '3.3'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: yard
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - ~>
|
101
|
+
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0.8'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - ~>
|
108
|
+
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0.8'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: codeclimate-test-reporter
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - ~>
|
115
|
+
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0.4'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- - ~>
|
122
|
+
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0.4'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: fuubar
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- - ~>
|
129
|
+
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '2.0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- - ~>
|
136
|
+
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '2.0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: rgitflow
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- - ~>
|
143
|
+
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0.2'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- - ~>
|
150
|
+
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0.2'
|
153
153
|
description: Uses the RubyGems style of versioning in order to ease updates.
|
@@ -159,13 +159,13 @@ extra_rdoc_files:
|
|
159
159
|
- LICENSE.txt
|
160
160
|
- README.rdoc
|
161
161
|
files:
|
162
|
-
- .codeclimate.yml
|
163
|
-
- .document
|
164
|
-
- .gitignore
|
165
|
-
- .rgitflow
|
166
|
-
- .rspec
|
167
|
-
- .travis.yml
|
168
|
-
- .yardopts
|
162
|
+
- ".codeclimate.yml"
|
163
|
+
- ".document"
|
164
|
+
- ".gitignore"
|
165
|
+
- ".rgitflow"
|
166
|
+
- ".rspec"
|
167
|
+
- ".travis.yml"
|
168
|
+
- ".yardopts"
|
169
169
|
- CODE_OF_CONDUCT.md
|
170
170
|
- ChangeLog.rdoc
|
171
171
|
- Gemfile
|
@@ -179,6 +179,7 @@ files:
|
|
179
179
|
- lib/timewizard/versioner.rb
|
180
180
|
- lib/timewizard/versioner/android.rb
|
181
181
|
- lib/timewizard/versioner/apple.rb
|
182
|
+
- lib/timewizard/versioner/cordova.rb
|
182
183
|
- lib/timewizard/versioner/worklight.rb
|
183
184
|
- resources/android/AndroidManifest.xml
|
184
185
|
- resources/apple/TestApp/TestApp.xcodeproj/project.pbxproj
|
@@ -194,6 +195,7 @@ files:
|
|
194
195
|
- resources/apple/TestApp/TestApp/main.m
|
195
196
|
- resources/apple/TestApp/TestAppTests/Info.plist
|
196
197
|
- resources/apple/TestApp/TestAppTests/TestAppTests.m
|
198
|
+
- resources/cordova/config.xml
|
197
199
|
- resources/worklight/application-descriptor.xml
|
198
200
|
- timewizard.gemspec
|
199
201
|
homepage: https://nunnery.github.io/timewizard
|
@@ -206,18 +208,19 @@ require_paths:
|
|
206
208
|
- lib
|
207
209
|
required_ruby_version: !ruby/object:Gem::Requirement
|
208
210
|
requirements:
|
209
|
-
- -
|
211
|
+
- - ">="
|
210
212
|
- !ruby/object:Gem::Version
|
211
213
|
version: '0'
|
212
214
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
213
215
|
requirements:
|
214
|
-
- -
|
216
|
+
- - ">="
|
215
217
|
- !ruby/object:Gem::Version
|
216
218
|
version: '0'
|
217
219
|
requirements: []
|
218
220
|
rubyforge_project:
|
219
|
-
rubygems_version: 2.
|
221
|
+
rubygems_version: 2.5.1
|
220
222
|
signing_key:
|
221
223
|
specification_version: 4
|
222
224
|
summary: A Ruby library for parsing and changing iOS and Android version numbers.
|
223
225
|
test_files: []
|
226
|
+
has_rdoc:
|