appium_thor 1.0.1 → 1.1.0
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.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/appium_thor.gemspec +2 -4
- data/docs/helpers_docs.md +14 -14
- data/lib/appium_thor/config.rb +2 -2
- data/lib/appium_thor/docs.rb +13 -23
- data/lib/appium_thor/helpers.rb +14 -10
- data/lib/appium_thor/version.rb +2 -2
- data/release_notes.md +9 -4
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce91a20d735d6b7cf091bb4456c3eab1459dfc29
|
4
|
+
data.tar.gz: 8957f2d51ade12824b92e5c2d698948636cb7176
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3af645fbf72d1d603ff6b1cfdb2e424babd85711c5becb7eb0fc53a619f658d6e69b9253808ce35f9a39b5967520c90497369305bf40a7283cef98864b8d04d1
|
7
|
+
data.tar.gz: 319f6ebd4c7e655e4448005d631e5f3e43b62b492bf0596e734983250cb525c26bd1e176353e15ffb8b1c0ff7c8c8ec530d236696c5c99b87f942563609fec6e
|
data/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
# appium_thor
|
1
|
+
# appium_thor
|
2
|
+
|
3
|
+
[](https://rubygems.org/gems/appium_thor)
|
2
4
|
|
3
5
|
|
4
6
|
Appium Thor helpers for appium's gems (appium_lib, appium_capybara).
|
data/appium_thor.gemspec
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
require_relative 'lib/appium_thor/version'
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
|
-
|
5
|
-
s.required_ruby_version = '>= 1.9.3'
|
4
|
+
s.required_ruby_version = '>= 2.2'
|
6
5
|
|
7
6
|
s.name = 'appium_thor'
|
8
7
|
s.version = Appium::Thor::VERSION
|
9
8
|
s.date = Appium::Thor::DATE
|
10
9
|
s.license = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
11
|
-
s.description = s.summary = 'Thor tasks for Appium gems'
|
12
|
-
s.description += '.' # avoid identical warning
|
10
|
+
s.description = s.summary = 'Thor tasks for Appium gems.'
|
13
11
|
s.authors = s.email = ['code@bootstraponline.com']
|
14
12
|
s.homepage = 'https://github.com/appium/appium_thor'
|
15
13
|
s.require_paths = ['lib']
|
data/docs/helpers_docs.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
##### [_build_gem](https://github.com/appium/appium_thor/blob/
|
1
|
+
##### [_build_gem](https://github.com/appium/appium_thor/blob/5c7bcaff616abd2b0593f056a940d64f5b0ce3c2/lib/appium_thor/helpers.rb#L6)
|
2
2
|
|
3
3
|
> def _build_gem
|
4
4
|
|
@@ -7,23 +7,23 @@ Runs gem build gemspec
|
|
7
7
|
|
8
8
|
--
|
9
9
|
|
10
|
-
##### [tag_exists](https://github.com/appium/appium_thor/blob/
|
10
|
+
##### [tag_exists](https://github.com/appium/appium_thor/blob/5c7bcaff616abd2b0593f056a940d64f5b0ce3c2/lib/appium_thor/helpers.rb#L12)
|
11
11
|
|
12
|
-
> def tag_exists
|
12
|
+
> def tag_exists(tag_name)
|
13
13
|
|
14
14
|
Returns true if the tag exists on the master branch.
|
15
15
|
|
16
16
|
--
|
17
17
|
|
18
|
-
##### [sh](https://github.com/appium/appium_thor/blob/
|
18
|
+
##### [sh](https://github.com/appium/appium_thor/blob/5c7bcaff616abd2b0593f056a940d64f5b0ce3c2/lib/appium_thor/helpers.rb#L18)
|
19
19
|
|
20
|
-
> def sh
|
20
|
+
> def sh(command)
|
21
21
|
|
22
22
|
Runs command. Raises an exception if the command doesn't execute successfully.
|
23
23
|
|
24
24
|
--
|
25
25
|
|
26
|
-
##### [version_rgx](https://github.com/appium/appium_thor/blob/
|
26
|
+
##### [version_rgx](https://github.com/appium/appium_thor/blob/5c7bcaff616abd2b0593f056a940d64f5b0ce3c2/lib/appium_thor/helpers.rb#L30)
|
27
27
|
|
28
28
|
> def version_rgx
|
29
29
|
|
@@ -31,7 +31,7 @@ Used to parse the version number from version_file
|
|
31
31
|
|
32
32
|
--
|
33
33
|
|
34
|
-
##### [version](https://github.com/appium/appium_thor/blob/
|
34
|
+
##### [version](https://github.com/appium/appium_thor/blob/5c7bcaff616abd2b0593f056a940d64f5b0ce3c2/lib/appium_thor/helpers.rb#L35)
|
35
35
|
|
36
36
|
> def version
|
37
37
|
|
@@ -39,9 +39,9 @@ Returns the version number from version_file as a string
|
|
39
39
|
|
40
40
|
--
|
41
41
|
|
42
|
-
##### [_bump](https://github.com/appium/appium_thor/blob/
|
42
|
+
##### [_bump](https://github.com/appium/appium_thor/blob/5c7bcaff616abd2b0593f056a940d64f5b0ce3c2/lib/appium_thor/helpers.rb#L46)
|
43
43
|
|
44
|
-
> def _bump
|
44
|
+
> def _bump(value)
|
45
45
|
|
46
46
|
Updates the date and version in version_file.
|
47
47
|
Prints the new version and date to the console.
|
@@ -55,7 +55,7 @@ __Parameters:__
|
|
55
55
|
|
56
56
|
--
|
57
57
|
|
58
|
-
##### [update_release_notes](https://github.com/appium/appium_thor/blob/
|
58
|
+
##### [update_release_notes](https://github.com/appium/appium_thor/blob/5c7bcaff616abd2b0593f056a940d64f5b0ce3c2/lib/appium_thor/helpers.rb#L86)
|
59
59
|
|
60
60
|
> def update_release_notes
|
61
61
|
|
@@ -64,7 +64,7 @@ Note that the first tag won't contain notes.
|
|
64
64
|
|
65
65
|
--
|
66
66
|
|
67
|
-
##### [_install](https://github.com/appium/appium_thor/blob/
|
67
|
+
##### [_install](https://github.com/appium/appium_thor/blob/5c7bcaff616abd2b0593f056a940d64f5b0ce3c2/lib/appium_thor/helpers.rb#L150)
|
68
68
|
|
69
69
|
> def _install
|
70
70
|
|
@@ -76,7 +76,7 @@ Installs the local gem. It's fast due to the flags
|
|
76
76
|
|
77
77
|
--
|
78
78
|
|
79
|
-
##### [_uninstall](https://github.com/appium/appium_thor/blob/
|
79
|
+
##### [_uninstall](https://github.com/appium/appium_thor/blob/5c7bcaff616abd2b0593f056a940d64f5b0ce3c2/lib/appium_thor/helpers.rb#L157)
|
80
80
|
|
81
81
|
> def _uninstall
|
82
82
|
|
@@ -84,7 +84,7 @@ Uninstalls all versions of the gem
|
|
84
84
|
|
85
85
|
--
|
86
86
|
|
87
|
-
##### [_publish](https://github.com/appium/appium_thor/blob/
|
87
|
+
##### [_publish](https://github.com/appium/appium_thor/blob/5c7bcaff616abd2b0593f056a940d64f5b0ce3c2/lib/appium_thor/helpers.rb#L168)
|
88
88
|
|
89
89
|
> def _publish
|
90
90
|
|
@@ -96,7 +96,7 @@ Publishes the gem to rubygems
|
|
96
96
|
|
97
97
|
--
|
98
98
|
|
99
|
-
##### [remove_non_ascii_from_cwd](https://github.com/appium/appium_thor/blob/
|
99
|
+
##### [remove_non_ascii_from_cwd](https://github.com/appium/appium_thor/blob/5c7bcaff616abd2b0593f056a940d64f5b0ce3c2/lib/appium_thor/helpers.rb#L200)
|
100
100
|
|
101
101
|
> def remove_non_ascii_from_cwd
|
102
102
|
|
data/lib/appium_thor/config.rb
CHANGED
@@ -21,7 +21,7 @@ module Appium
|
|
21
21
|
|
22
22
|
# block of code to execute that contains documentation
|
23
23
|
# generation logic
|
24
|
-
def docs_block
|
24
|
+
def docs_block(&block)
|
25
25
|
return @docs_block if @docs_block
|
26
26
|
@docs_block = block
|
27
27
|
end
|
@@ -53,7 +53,7 @@ module Appium
|
|
53
53
|
# github_name 'appium_thor'
|
54
54
|
# version_file 'path/to/version.rb'
|
55
55
|
# end
|
56
|
-
def self.set
|
56
|
+
def self.set(&block)
|
57
57
|
config = self.instance
|
58
58
|
config.instance_eval &block
|
59
59
|
config.init_and_validate
|
data/lib/appium_thor/docs.rb
CHANGED
@@ -25,33 +25,33 @@ module Appium
|
|
25
25
|
end
|
26
26
|
|
27
27
|
method_path = obj.file.split('/lib/').last
|
28
|
-
os
|
29
|
-
out
|
30
|
-
out
|
31
|
-
out
|
28
|
+
os = method_path.downcase.match /ios|android/
|
29
|
+
out.concat("##### [#{obj.name.to_s}](https://github.com/#{github_owner}/#{github_name}/blob/#{last_sha}/lib/#{method_path}#L#{obj.line}) #{os}\n\n")
|
30
|
+
out.concat("> #{obj.signature}\n\n")
|
31
|
+
out.concat("#{obj.docstring}\n\n")
|
32
32
|
|
33
33
|
|
34
34
|
indent = space 5
|
35
35
|
params = obj.tags.select { |tag| tag.tag_name == 'param' }
|
36
|
-
|
37
|
-
out
|
36
|
+
unless params.empty?
|
37
|
+
out.concat("__Parameters:__\n\n")
|
38
38
|
params.each do |param|
|
39
|
-
out
|
40
|
-
out
|
39
|
+
out.concat("#{indent}[#{param.types.join ', '}] ")
|
40
|
+
out.concat("#{param.name} - #{param.text}\n\n")
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
44
|
ret = obj.tag 'return'
|
45
45
|
if ret
|
46
|
-
out
|
47
|
-
out
|
46
|
+
out.concat("__Returns:__\n\n")
|
47
|
+
out.concat("#{indent}[#{ret.types.join ', '}] #{ret.text}\n\n")
|
48
48
|
end
|
49
|
-
out
|
49
|
+
out.concat("--\n\n")
|
50
50
|
|
51
51
|
out
|
52
52
|
end
|
53
53
|
|
54
|
-
def run
|
54
|
+
def run(out_file, globs)
|
55
55
|
YARD::Registry.clear
|
56
56
|
puts "Globbing: #{globs}"
|
57
57
|
puts "Writing: #{out_file}"
|
@@ -70,22 +70,12 @@ module Appium
|
|
70
70
|
raise 'Empty file generated' if File.size(out_file) <= 0
|
71
71
|
end
|
72
72
|
|
73
|
-
def globs
|
73
|
+
def globs(paths)
|
74
74
|
# Convert single string to array for map
|
75
75
|
paths = [paths] unless paths.kind_of? Array
|
76
76
|
# Adjust path based on system
|
77
77
|
paths.map! { |path| "#{Dir.pwd}#{path}" }
|
78
78
|
end
|
79
|
-
|
80
|
-
=begin
|
81
|
-
common_globs = '/lib/appium_lib/*.rb', '/lib/appium_lib/device/*.rb', '/lib/appium_lib/common/**/*.rb'
|
82
|
-
android_globs = common_globs + ['/lib/appium_lib/android/**/*.rb']
|
83
|
-
ios_globs = common_globs + ['/lib/appium_lib/ios/**/*.rb']
|
84
|
-
|
85
|
-
run 'docs/android_docs.md', globs(android_globs)
|
86
|
-
|
87
|
-
run 'docs/ios_docs.md', globs(ios_globs)
|
88
|
-
=end
|
89
79
|
end
|
90
80
|
end
|
91
81
|
end
|
data/lib/appium_thor/helpers.rb
CHANGED
@@ -9,13 +9,13 @@ module Appium
|
|
9
9
|
end
|
10
10
|
|
11
11
|
# Returns true if the tag exists on the master branch.
|
12
|
-
def tag_exists
|
12
|
+
def tag_exists(tag_name)
|
13
13
|
cmd = %Q(git branch -a --contains "#{tag_name}")
|
14
14
|
POSIX::Spawn::Child.new(cmd).out.include? '* master'
|
15
15
|
end
|
16
16
|
|
17
17
|
# Runs command. Raises an exception if the command doesn't execute successfully.
|
18
|
-
def sh
|
18
|
+
def sh(command)
|
19
19
|
process = POSIX::Spawn::Child.new command
|
20
20
|
|
21
21
|
unless process.success?
|
@@ -43,7 +43,7 @@ module Appium
|
|
43
43
|
# x.y.z
|
44
44
|
#
|
45
45
|
# @param value [symbol] value is either :x, :y, or :z. Default is z.
|
46
|
-
def _bump
|
46
|
+
def _bump(value)
|
47
47
|
data = File.read version_file
|
48
48
|
|
49
49
|
v_line = data.match version_rgx
|
@@ -97,8 +97,9 @@ module Appium
|
|
97
97
|
begin
|
98
98
|
tags.sort! &tag_sort
|
99
99
|
rescue
|
100
|
-
|
101
|
-
|
100
|
+
message = 'Skipping release notes (unable to sort)'
|
101
|
+
$stderr.puts message
|
102
|
+
fail message
|
102
103
|
end
|
103
104
|
pairs = []
|
104
105
|
tags.each_index { |a| pairs.push tags[a] + '...' + tags[a+1] unless tags[a+1].nil? }
|
@@ -130,12 +131,12 @@ module Appium
|
|
130
131
|
# use first 7 chars to match GitHub
|
131
132
|
comment = line.gsub(hex, '').strip
|
132
133
|
next if comment == 'Update release notes'
|
133
|
-
new_data
|
134
|
+
new_data.concat("- [#{hex[0...7]}](https://github.com/#{github_owner}/#{github_name}/commit/#{hex}) #{comment}\n")
|
134
135
|
end
|
135
|
-
data = new_data
|
136
|
+
data = "#{new_data}\n"
|
136
137
|
|
137
138
|
# last pair is the released version.
|
138
|
-
notes
|
139
|
+
notes.concat("#### #{tag_date[a]}\n\n#{data}\n")
|
139
140
|
end
|
140
141
|
|
141
142
|
File.open('release_notes.md', 'w') { |f| f.write notes.to_s.strip }
|
@@ -181,10 +182,13 @@ module Appium
|
|
181
182
|
sh "git commit --allow-empty -am 'Release #{version}'"
|
182
183
|
sh 'git pull'
|
183
184
|
sh "git tag #{tag_name}"
|
185
|
+
|
186
|
+
notes_failed = false
|
187
|
+
|
184
188
|
# update notes now that there's a new tag
|
185
|
-
notes
|
189
|
+
notes rescue notes_failed = true
|
186
190
|
docs
|
187
|
-
sh "git commit --allow-empty -am 'Update release notes'"
|
191
|
+
sh "git commit --allow-empty -am 'Update release notes'" unless notes_failed
|
188
192
|
sh 'git push origin master'
|
189
193
|
sh "git push origin #{tag_name}"
|
190
194
|
_build_gem
|
data/lib/appium_thor/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Appium
|
2
2
|
module Thor
|
3
|
-
VERSION = '1.0
|
4
|
-
DATE = '
|
3
|
+
VERSION = '1.1.0' unless defined? ::Appium::Thor::VERSION
|
4
|
+
DATE = '2018-11-12' unless defined? ::Appium::Thor::DATE
|
5
5
|
end
|
6
6
|
end
|
data/release_notes.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
#### v1.1.0 2018-11-12
|
2
|
+
|
3
|
+
- [5c7bcaf](https://github.com/appium/appium_thor/commit/5c7bcaff616abd2b0593f056a940d64f5b0ce3c2) Release 1.1.0
|
4
|
+
- [9c39741](https://github.com/appium/appium_thor/commit/9c3974152191d983cad71cc60b412ff1788d973c) remove dependency status from readme since it was moved to gitlab
|
5
|
+
- [94038c5](https://github.com/appium/appium_thor/commit/94038c50da0683c308dd251759d743190cbe53bc) Merge pull request #3 from KazuCocoa/bump-ruby-version
|
6
|
+
- [3a30951](https://github.com/appium/appium_thor/commit/3a309515c46fec8424bacdcc929e6c1e56b50066) bump ruby version
|
7
|
+
- [80ec9cd](https://github.com/appium/appium_thor/commit/80ec9cdd97fc1dd2d7d857674ab2629571cd9fea) Avoid empty notes commit on failure
|
8
|
+
|
9
|
+
|
1
10
|
#### v1.0.1 2015-06-19
|
2
11
|
|
3
12
|
- [b9b553a](https://github.com/appium/appium_thor/commit/b9b553ae60ea2b1d435560aae5f08c7798b6f52d) Release 1.0.1
|
@@ -45,9 +54,5 @@
|
|
45
54
|
|
46
55
|
- [b0f4217](https://github.com/appium/appium_thor/commit/b0f42170c7b7df3befa9651647ea8c65ecd86710) Release 0.0.4
|
47
56
|
- [68f6e7b](https://github.com/appium/appium_thor/commit/68f6e7b4d641017eee1123fbcc9872940adf37b8) Fix update_release_notes
|
48
|
-
|
49
|
-
|
50
|
-
#### v0.0.3 2014-07-31
|
51
|
-
|
52
57
|
- [71b4199](https://github.com/appium/appium_thor/commit/71b419998ce835cf1e722563cd9ba99d89da6fb0) Release 0.0.3
|
53
58
|
- [9904612](https://github.com/appium/appium_thor/commit/99046121f53f42bebb0cea4971f89b91c358da22) Testing release notes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appium_thor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- code@bootstraponline.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redcarpet
|
@@ -104,7 +104,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
104
|
requirements:
|
105
105
|
- - ">="
|
106
106
|
- !ruby/object:Gem::Version
|
107
|
-
version:
|
107
|
+
version: '2.2'
|
108
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
110
|
- - ">="
|
@@ -112,9 +112,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
112
|
version: '0'
|
113
113
|
requirements: []
|
114
114
|
rubyforge_project:
|
115
|
-
rubygems_version: 2.
|
115
|
+
rubygems_version: 2.6.14
|
116
116
|
signing_key:
|
117
117
|
specification_version: 4
|
118
|
-
summary: Thor tasks for Appium gems
|
118
|
+
summary: Thor tasks for Appium gems.
|
119
119
|
test_files: []
|
120
|
-
has_rdoc:
|