appium_thor 1.2.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -21
- data/Thorfile +1 -4
- data/appium_thor.gemspec +1 -3
- data/lib/appium_thor/commands/commands.rb +5 -6
- data/lib/appium_thor/commands/init.rb +0 -1
- data/lib/appium_thor/config.rb +1 -8
- data/lib/appium_thor/helpers.rb +7 -8
- data/lib/appium_thor/version.rb +2 -2
- data/lib/appium_thor.rb +1 -3
- data/release_notes.md +13 -0
- metadata +7 -42
- data/lib/appium_thor/docs.rb +0 -82
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f010047f801d945595ef7c30962f5786504a366f027dd6a400b529ccc75da189
|
4
|
+
data.tar.gz: 1a18da01653a6231d2509ea8fcbe9b4c2be029dad9a5c56d2c59a35b32e76bf6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 796ad8085c6abf3b5510f142ceababfd613ad0ffbc1e8f11aa606978cbdaac755105500f1635c8afae5a8a5560eff16f4420aa2a1b36a816d7fb80b6bb7f0935
|
7
|
+
data.tar.gz: 3f454f49e0e74a0281ef997edc7a6758a62d74c621023779646043fc25be6f11e6a60d5c0734880f2a42e6f00bf2777f6a195e819bc348819a0a83a529ab789c
|
data/README.md
CHANGED
@@ -16,9 +16,6 @@ Appium::Thor::Config.set do
|
|
16
16
|
github_name 'appium_thor'
|
17
17
|
branch 'master'
|
18
18
|
version_file 'lib/appium_thor/version.rb'
|
19
|
-
docs_block do
|
20
|
-
run 'docs/helpers_docs.md', globs('/lib/appium_thor/helpers.rb')
|
21
|
-
end
|
22
19
|
end
|
23
20
|
|
24
21
|
# Must use '::' otherwise Default will point to Thor::Sandbox::Default
|
@@ -43,7 +40,6 @@ end
|
|
43
40
|
|github_name | `#{gem_name}`|
|
44
41
|
|branch | `master`|
|
45
42
|
|version_file | `lib/#{gem_name}/version.rb`|
|
46
|
-
|docs_block | no docs are generated|
|
47
43
|
|
48
44
|
`branch` customises the target branch to push changes.
|
49
45
|
Defaults to `master`
|
@@ -60,7 +56,6 @@ thor bump # Bump the z version number and update the date.
|
|
60
56
|
thor bumpx # Bump the x version number, set y & z to zero, update the date.
|
61
57
|
thor bumpy # Bump the y version number, set z to zero, update the date.
|
62
58
|
thor byte # Remove non-ascii bytes from all *.rb files in the current dir
|
63
|
-
thor docs # Update docs
|
64
59
|
thor gem_install # Install gem
|
65
60
|
thor gem_uninstall # Uninstall gem
|
66
61
|
thor info # prints config info for this gem
|
@@ -68,19 +63,3 @@ thor notes # Update release notes
|
|
68
63
|
thor publish # Build and release a new gem to rubygems.org
|
69
64
|
thor release # Build and release a new gem to rubygems.org (same as publish)
|
70
65
|
```
|
71
|
-
|
72
|
-
--
|
73
|
-
|
74
|
-
# docs_block
|
75
|
-
|
76
|
-
The `docs_block` method runs within the `docs.rb` context. Here's a more complex example:
|
77
|
-
|
78
|
-
```ruby
|
79
|
-
common_globs = '/lib/appium_lib/*.rb', '/lib/appium_lib/device/*.rb', '/lib/appium_lib/common/**/*.rb'
|
80
|
-
android_globs = common_globs + ['/lib/appium_lib/android/**/*.rb']
|
81
|
-
ios_globs = common_globs + ['/lib/appium_lib/ios/**/*.rb']
|
82
|
-
|
83
|
-
run 'docs/android_docs.md', globs(android_globs)
|
84
|
-
|
85
|
-
run 'docs/ios_docs.md', globs(ios_globs)
|
86
|
-
```
|
data/Thorfile
CHANGED
data/appium_thor.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative 'lib/appium_thor/version'
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
|
-
s.required_ruby_version = '>=
|
4
|
+
s.required_ruby_version = '>= 3.0'
|
5
5
|
|
6
6
|
s.name = 'appium_thor'
|
7
7
|
s.version = Appium::Thor::VERSION
|
@@ -13,8 +13,6 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.require_paths = ['lib']
|
14
14
|
|
15
15
|
s.add_runtime_dependency 'redcarpet', '~> 3.1', '>= 3.1.2'
|
16
|
-
s.add_runtime_dependency 'posix-spawn', '~> 0.3', '>= 0.3.8'
|
17
|
-
s.add_runtime_dependency 'yard', '~> 0.9.11'
|
18
16
|
|
19
17
|
s.files = `git ls-files`.split "\n"
|
20
18
|
end
|
@@ -55,11 +55,6 @@ version_file: #{version_file}
|
|
55
55
|
_install
|
56
56
|
end
|
57
57
|
|
58
|
-
desc 'docs', 'Update docs'
|
59
|
-
def docs
|
60
|
-
instance_eval &docs_block if docs_block
|
61
|
-
end
|
62
|
-
|
63
58
|
desc 'notes', 'Update release notes'
|
64
59
|
def notes
|
65
60
|
update_release_notes
|
@@ -69,4 +64,8 @@ version_file: #{version_file}
|
|
69
64
|
def byte
|
70
65
|
remove_non_ascii_from_cwd
|
71
66
|
end
|
72
|
-
|
67
|
+
|
68
|
+
def self.exit_on_failure?
|
69
|
+
true
|
70
|
+
end
|
71
|
+
end
|
data/lib/appium_thor/config.rb
CHANGED
@@ -21,16 +21,9 @@ module Appium
|
|
21
21
|
raise "version file doesn't exist #{@version_file}" unless File.exist?(@version_file)
|
22
22
|
end
|
23
23
|
|
24
|
-
# block of code to execute that contains documentation
|
25
|
-
# generation logic
|
26
|
-
def docs_block(&block)
|
27
|
-
return @docs_block if @docs_block
|
28
|
-
@docs_block = block
|
29
|
-
end
|
30
|
-
|
31
24
|
# Returns all options as symbols. Required for defining delegators in init.rb
|
32
25
|
def self.options
|
33
|
-
string_options
|
26
|
+
string_options
|
34
27
|
end
|
35
28
|
|
36
29
|
# the subset of options that operate on strings
|
data/lib/appium_thor/helpers.rb
CHANGED
@@ -4,26 +4,26 @@ module Appium
|
|
4
4
|
# Sets the permissions on the gem credentials
|
5
5
|
# Runs gem build gemspec
|
6
6
|
def _build_gem
|
7
|
-
`chmod 0600 ~/.gem/credentials`
|
8
7
|
sh "gem build #{gem_name}.gemspec"
|
9
8
|
end
|
10
9
|
|
11
10
|
# Returns true if the tag exists on the master branch.
|
12
11
|
def tag_exists(tag_name)
|
13
12
|
cmd = %Q(git branch -a --contains "#{tag_name}")
|
14
|
-
|
13
|
+
stdout, status = Open3.capture2(cmd)
|
14
|
+
stdout.include? "* #{branch}"
|
15
|
+
|
15
16
|
end
|
16
17
|
|
17
18
|
# Runs command. Raises an exception if the command doesn't execute successfully.
|
18
19
|
def sh(command)
|
19
|
-
|
20
|
+
stdout, stderr, status = Open3.capture3(command)
|
20
21
|
|
21
|
-
unless
|
22
|
-
raise "Command #{command} failed. out: #{
|
22
|
+
unless status.success?
|
23
|
+
raise "Command #{command} failed. out: #{stdout}\nerr: #{stderr}"
|
23
24
|
end
|
24
25
|
|
25
|
-
|
26
|
-
out ? out.strip : out
|
26
|
+
stdout.strip
|
27
27
|
end
|
28
28
|
|
29
29
|
# Used to parse the version number from version_file
|
@@ -187,7 +187,6 @@ module Appium
|
|
187
187
|
|
188
188
|
# update notes now that there's a new tag
|
189
189
|
notes rescue notes_failed = true
|
190
|
-
docs
|
191
190
|
sh "git commit --allow-empty -am 'Update release notes'" unless notes_failed
|
192
191
|
sh "git push origin #{branch}"
|
193
192
|
sh "git push origin #{tag_name}"
|
data/lib/appium_thor/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Appium
|
2
2
|
module Thor
|
3
|
-
VERSION = '
|
4
|
-
DATE = '
|
3
|
+
VERSION = '2.0.1' unless defined? ::Appium::Thor::VERSION
|
4
|
+
DATE = '2024-04-26' unless defined? ::Appium::Thor::DATE
|
5
5
|
end
|
6
6
|
end
|
data/lib/appium_thor.rb
CHANGED
@@ -2,15 +2,13 @@
|
|
2
2
|
require 'forwardable' # commands.rb
|
3
3
|
require 'singleton' # config.rb
|
4
4
|
require 'fileutils'
|
5
|
+
require 'open3'
|
5
6
|
|
6
7
|
# gems
|
7
8
|
require 'rubygems'
|
8
|
-
require 'yard' # docs.rb
|
9
|
-
require 'posix-spawn' # helpers.rb
|
10
9
|
require 'date' # helpers.rb Date.today
|
11
10
|
|
12
11
|
# internal
|
13
|
-
require_relative 'appium_thor/docs'
|
14
12
|
require_relative 'appium_thor/helpers'
|
15
13
|
require_relative 'appium_thor/version'
|
16
14
|
require_relative 'appium_thor/config'
|
data/release_notes.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
#### v2.0.1 2024-04-26
|
2
|
+
|
3
|
+
- [12d7e59](https://github.com/appium/appium_thor/commit/12d7e59aa1cb41dcb0731e94bb183daead92c9ba) Release 2.0.1
|
4
|
+
|
5
|
+
|
6
|
+
#### v2.0.0 2024-04-26
|
7
|
+
|
8
|
+
- [e83d36e](https://github.com/appium/appium_thor/commit/e83d36e65c48dcfc71b00d28837a4c57517cc6b2) Release 2.0.0
|
9
|
+
- [021199b](https://github.com/appium/appium_thor/commit/021199b3bb179432cac93709292a275470f4bca7) chore: remove posix-spawn
|
10
|
+
- [11848db](https://github.com/appium/appium_thor/commit/11848db549003ba9b267622eb3e2677c4b9a004d) chore: use ruby 3+
|
11
|
+
- [3b3cf1d](https://github.com/appium/appium_thor/commit/3b3cf1d278ec18923875c5469e4e1da31df92472) feat: remove docs (#8)
|
12
|
+
|
13
|
+
|
1
14
|
#### v1.2.0 2020-06-14
|
2
15
|
|
3
16
|
- [5c7025a](https://github.com/appium/appium_thor/commit/5c7025a14e9a6dba1ff0f69b733983d965e9c2ee) Release 1.2.0
|
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:
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- code@bootstraponline.com
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redcarpet
|
@@ -30,40 +30,6 @@ dependencies:
|
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 3.1.2
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: posix-spawn
|
35
|
-
requirement: !ruby/object:Gem::Requirement
|
36
|
-
requirements:
|
37
|
-
- - "~>"
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: '0.3'
|
40
|
-
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: 0.3.8
|
43
|
-
type: :runtime
|
44
|
-
prerelease: false
|
45
|
-
version_requirements: !ruby/object:Gem::Requirement
|
46
|
-
requirements:
|
47
|
-
- - "~>"
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: '0.3'
|
50
|
-
- - ">="
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: 0.3.8
|
53
|
-
- !ruby/object:Gem::Dependency
|
54
|
-
name: yard
|
55
|
-
requirement: !ruby/object:Gem::Requirement
|
56
|
-
requirements:
|
57
|
-
- - "~>"
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: 0.9.11
|
60
|
-
type: :runtime
|
61
|
-
prerelease: false
|
62
|
-
version_requirements: !ruby/object:Gem::Requirement
|
63
|
-
requirements:
|
64
|
-
- - "~>"
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
version: 0.9.11
|
67
33
|
description: Thor tasks for Appium gems.
|
68
34
|
email:
|
69
35
|
- code@bootstraponline.com
|
@@ -82,7 +48,6 @@ files:
|
|
82
48
|
- lib/appium_thor/commands/commands.rb
|
83
49
|
- lib/appium_thor/commands/init.rb
|
84
50
|
- lib/appium_thor/config.rb
|
85
|
-
- lib/appium_thor/docs.rb
|
86
51
|
- lib/appium_thor/helpers.rb
|
87
52
|
- lib/appium_thor/version.rb
|
88
53
|
- release_notes.md
|
@@ -90,7 +55,7 @@ homepage: https://github.com/appium/appium_thor
|
|
90
55
|
licenses:
|
91
56
|
- http://www.apache.org/licenses/LICENSE-2.0.txt
|
92
57
|
metadata: {}
|
93
|
-
post_install_message:
|
58
|
+
post_install_message:
|
94
59
|
rdoc_options: []
|
95
60
|
require_paths:
|
96
61
|
- lib
|
@@ -98,15 +63,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
98
63
|
requirements:
|
99
64
|
- - ">="
|
100
65
|
- !ruby/object:Gem::Version
|
101
|
-
version: '
|
66
|
+
version: '3.0'
|
102
67
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
68
|
requirements:
|
104
69
|
- - ">="
|
105
70
|
- !ruby/object:Gem::Version
|
106
71
|
version: '0'
|
107
72
|
requirements: []
|
108
|
-
rubygems_version: 3.
|
109
|
-
signing_key:
|
73
|
+
rubygems_version: 3.5.9
|
74
|
+
signing_key:
|
110
75
|
specification_version: 4
|
111
76
|
summary: Thor tasks for Appium gems.
|
112
77
|
test_files: []
|
data/lib/appium_thor/docs.rb
DELETED
@@ -1,82 +0,0 @@
|
|
1
|
-
module Appium
|
2
|
-
module Thor
|
3
|
-
module Docs
|
4
|
-
def space amount
|
5
|
-
' ' * amount
|
6
|
-
end
|
7
|
-
|
8
|
-
def last_sha
|
9
|
-
`git rev-parse --verify HEAD`.strip
|
10
|
-
end
|
11
|
-
|
12
|
-
def mobj_to_md obj
|
13
|
-
out = ''
|
14
|
-
# skip objects without method signatures
|
15
|
-
sig = obj.signature
|
16
|
-
return out unless sig
|
17
|
-
|
18
|
-
# skip class vars
|
19
|
-
if sig.start_with?('@@') ||
|
20
|
-
# skip methods marked private
|
21
|
-
obj.tag('private') ||
|
22
|
-
# skip date and version from version.rb
|
23
|
-
obj.name.match(/DATE|VERSION/)
|
24
|
-
|
25
|
-
return out
|
26
|
-
end
|
27
|
-
|
28
|
-
method_path = obj.file.split('/lib/').last
|
29
|
-
os = method_path.downcase.match(/ios|android/) || 'common'
|
30
|
-
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")
|
31
|
-
out.concat("> #{obj.signature}\n\n")
|
32
|
-
out.concat("#{obj.docstring}\n\n")
|
33
|
-
|
34
|
-
|
35
|
-
indent = space 5
|
36
|
-
params = obj.tags.select { |tag| tag.tag_name == 'param' }
|
37
|
-
unless params.empty?
|
38
|
-
out.concat("__Parameters:__\n\n")
|
39
|
-
params.each do |param|
|
40
|
-
out.concat("#{indent}[#{param.types.join(', ') unless param.types.nil?}] ")
|
41
|
-
out.concat("#{param.name} - #{param.text}\n\n")
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
ret = obj.tag 'return'
|
46
|
-
if ret
|
47
|
-
out.concat("__Returns:__\n\n")
|
48
|
-
out.concat("#{indent}[#{ret.types.join(', ') unless ret.types.nil?}] #{ret.text}\n\n")
|
49
|
-
end
|
50
|
-
out.concat("--\n\n")
|
51
|
-
|
52
|
-
out
|
53
|
-
end
|
54
|
-
|
55
|
-
def run(out_file, globs)
|
56
|
-
YARD::Registry.clear
|
57
|
-
puts "Globbing: #{globs}"
|
58
|
-
puts "Writing: #{out_file}"
|
59
|
-
FileUtils.mkdir_p File.dirname out_file
|
60
|
-
YARD::Parser::SourceParser.parse globs
|
61
|
-
File.open(out_file, 'w') do |file|
|
62
|
-
entries = YARD::Registry.entries
|
63
|
-
entries_length = entries.length
|
64
|
-
puts "Processing: #{entries_length} entries"
|
65
|
-
raise 'No entries to process' if entries_length <= 0
|
66
|
-
YARD::Registry.entries.each do |entry|
|
67
|
-
file.write mobj_to_md entry
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
raise 'Empty file generated' if File.size(out_file) <= 0
|
72
|
-
end
|
73
|
-
|
74
|
-
def globs(paths)
|
75
|
-
# Convert single string to array for map
|
76
|
-
paths = [paths] unless paths.kind_of? Array
|
77
|
-
# Adjust path based on system
|
78
|
-
paths.map! { |path| "#{Dir.pwd}#{path}" }
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|