appium_thor 1.2.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc24b49b7f663d776fb593f9767227d3269719b66ff51401d0940c005794a03c
4
- data.tar.gz: 207e3e8d662f3bc569d6a36e407231ab9455e4228cc7698f9a4d7dd963e0f640
3
+ metadata.gz: cf2076f3692848707a188c8fd4894f6db4be3e9a3846c7ec968956bcff35996d
4
+ data.tar.gz: 9f7ae671336d09075b901b9d156d2472950ef6bf7bd576895aeb4e85600b83eb
5
5
  SHA512:
6
- metadata.gz: 118622a121311f5fe6e16c21ff9918e6eece9d43c2940a106e6d67b34220bdcffdcc2ba755bbe210fd9489564922695d53c63c7b7c37808f062dba4f162e281e
7
- data.tar.gz: 880766372aab982e0de70bd875884b6bed2c231ece910d458cf36deca4ec1f8cb8b29d8a71310da942c634619b1003e5226af3817c94906be2e92264a7a278d5
6
+ metadata.gz: cecba2f6985427e8c22512f1111a01d84f981e1ddb290d07af18e3a3aa91b5b9024e93742fa9ee9a61672b84a4022f9b587f5251c5251153630036f7d68fbec4
7
+ data.tar.gz: 63fe0809f01b8d8dc6ea4db7dd340a4644299199b7e673df187cccd748f88b1cb769637a32f75c3738bd6a9bdd9dacf96f161f373fd567d9d3fdb40a98306327
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
@@ -3,7 +3,4 @@ require File.expand_path '../lib/appium_thor', __FILE__
3
3
  Appium::Thor::Config.set do
4
4
  appium_thor = 'appium_thor'
5
5
  gem_name appium_thor
6
- docs_block do
7
- run 'docs/helpers_docs.md', globs("/lib/#{appium_thor}/helpers.rb")
8
- end
9
- end
6
+ end
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 = '>= 2.2'
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
- end
67
+
68
+ def self.exit_on_failure?
69
+ true
70
+ end
71
+ end
@@ -2,7 +2,6 @@
2
2
  class Default < Thor
3
3
  extend Forwardable
4
4
  include Appium::Thor::Helpers
5
- include Appium::Thor::Docs
6
5
 
7
6
  # For each possible option method, delegate calls to the config instance
8
7
  no_commands do
@@ -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 + [:docs_block]
26
+ string_options
34
27
  end
35
28
 
36
29
  # the subset of options that operate on strings
@@ -11,19 +11,20 @@ module Appium
11
11
  # Returns true if the tag exists on the master branch.
12
12
  def tag_exists(tag_name)
13
13
  cmd = %Q(git branch -a --contains "#{tag_name}")
14
- POSIX::Spawn::Child.new(cmd).out.include? "* #{branch}"
14
+ stdout, status = Open3.capture2(cmd)
15
+ stdout.include? "* #{branch}"
16
+
15
17
  end
16
18
 
17
19
  # Runs command. Raises an exception if the command doesn't execute successfully.
18
20
  def sh(command)
19
- process = POSIX::Spawn::Child.new command
21
+ stdout, stderr, status = Open3.capture3(command)
20
22
 
21
- unless process.success?
22
- raise "Command #{command} failed. out: #{process.out}\nerr: #{process.err}"
23
+ unless status.success?
24
+ raise "Command #{command} failed. out: #{stdout}\nerr: #{stderr}"
23
25
  end
24
26
 
25
- out = process.out
26
- out ? out.strip : out
27
+ stdout.strip
27
28
  end
28
29
 
29
30
  # Used to parse the version number from version_file
@@ -187,7 +188,6 @@ module Appium
187
188
 
188
189
  # update notes now that there's a new tag
189
190
  notes rescue notes_failed = true
190
- docs
191
191
  sh "git commit --allow-empty -am 'Update release notes'" unless notes_failed
192
192
  sh "git push origin #{branch}"
193
193
  sh "git push origin #{tag_name}"
@@ -1,6 +1,6 @@
1
1
  module Appium
2
2
  module Thor
3
- VERSION = '1.2.0' unless defined? ::Appium::Thor::VERSION
4
- DATE = '2020-06-14' unless defined? ::Appium::Thor::DATE
3
+ VERSION = '2.0.0' 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,11 @@
1
+ #### v2.0.0 2024-04-26
2
+
3
+ - [e83d36e](https://github.com/appium/appium_thor/commit/e83d36e65c48dcfc71b00d28837a4c57517cc6b2) Release 2.0.0
4
+ - [021199b](https://github.com/appium/appium_thor/commit/021199b3bb179432cac93709292a275470f4bca7) chore: remove posix-spawn
5
+ - [11848db](https://github.com/appium/appium_thor/commit/11848db549003ba9b267622eb3e2677c4b9a004d) chore: use ruby 3+
6
+ - [3b3cf1d](https://github.com/appium/appium_thor/commit/3b3cf1d278ec18923875c5469e4e1da31df92472) feat: remove docs (#8)
7
+
8
+
1
9
  #### v1.2.0 2020-06-14
2
10
 
3
11
  - [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: 1.2.0
4
+ version: 2.0.0
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: 2020-06-14 00:00:00.000000000 Z
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: '2.2'
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.0.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: []
@@ -1,82 +0,0 @@
1
- module Appium
2
- module Thor
3
- module Docs
4
- def space amount
5
- '&nbsp;' * 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