appium_thor 0.0.6 → 0.0.7
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 +14 -2
- data/Thorfile +3 -4
- data/docs/helpers_docs.md +11 -11
- data/lib/appium_thor/commands/commands.rb +4 -3
- data/lib/appium_thor/config.rb +29 -25
- data/lib/appium_thor/docs.rb +1 -1
- data/lib/appium_thor/helpers.rb +1 -1
- data/lib/appium_thor/version.rb +2 -2
- data/release_notes.md +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50b6ffdbb5b811a315cb71b3cf7b50d081e40c31
|
4
|
+
data.tar.gz: e583839ebde160f7c544e58f72d9d0349512f015
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50717847face8f220298419a29642488ab6420cd336f36c4df7c06485c77c054f0b98d803a065ceecb3896ce1483b7e5dbc03a3b14ff17149d41ce802ca8cbc6
|
7
|
+
data.tar.gz: 872aa18a67538845b4eacfcafa8ed7a6f7845494057b5017f46e4c37d46f664493c4bf07ebd217d1fc7e02be13abe45a11ed858c933520a94492579b529cf3c1
|
data/README.md
CHANGED
@@ -10,6 +10,7 @@ Appium Thor helpers for appium's gems (appium_lib, appium_capybara).
|
|
10
10
|
```ruby
|
11
11
|
Appium::Thor::Config.set do
|
12
12
|
gem_name 'appium_thor'
|
13
|
+
github_owner 'appium'
|
13
14
|
github_name 'appium_thor'
|
14
15
|
version_file 'lib/appium_thor/version.rb'
|
15
16
|
docs_block do
|
@@ -18,11 +19,22 @@ Appium::Thor::Config.set do
|
|
18
19
|
end
|
19
20
|
```
|
20
21
|
|
22
|
+
# Defaults
|
23
|
+
|
24
|
+
Option | Default
|
25
|
+
--:|:--
|
26
|
+
gem_name | must be provided
|
27
|
+
github_owner | `appium`
|
28
|
+
github_name | `#{gem_name}`
|
29
|
+
version_file | `lib/#{gem_name}/version.rb`
|
30
|
+
docs_block | no docs are generated
|
31
|
+
|
32
|
+
|
21
33
|
--
|
22
34
|
|
23
35
|
# Available tasks
|
24
36
|
|
25
|
-
Note to see gem warnings, run `gem build
|
37
|
+
Note to see gem warnings, run `gem build your_gem_name.gemspec`
|
26
38
|
|
27
39
|
```
|
28
40
|
thor build # Build a new gem
|
@@ -53,4 +65,4 @@ ios_globs = common_globs + ['/lib/appium_lib/ios/**/*.rb']
|
|
53
65
|
run 'docs/android_docs.md', globs(android_globs)
|
54
66
|
|
55
67
|
run 'docs/ios_docs.md', globs(ios_globs)
|
56
|
-
```
|
68
|
+
```
|
data/Thorfile
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
require File.expand_path '../lib/appium_thor', __FILE__
|
2
2
|
|
3
3
|
Appium::Thor::Config.set do
|
4
|
-
|
5
|
-
|
6
|
-
version_file 'lib/appium_thor/version.rb'
|
4
|
+
appium_thor = 'appium_thor'
|
5
|
+
gem_name appium_thor
|
7
6
|
docs_block do
|
8
|
-
run 'docs/helpers_docs.md', globs(
|
7
|
+
run 'docs/helpers_docs.md', globs("/lib/#{appium_thor}/helpers.rb")
|
9
8
|
end
|
10
9
|
end
|
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/e36ab29971eb4ccc0b5b4527f23dbb34bf590107/lib/appium_thor/helpers.rb#L6)
|
2
2
|
|
3
3
|
> def _build_gem
|
4
4
|
|
@@ -7,7 +7,7 @@ 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/e36ab29971eb4ccc0b5b4527f23dbb34bf590107/lib/appium_thor/helpers.rb#L12)
|
11
11
|
|
12
12
|
> def tag_exists tag_name
|
13
13
|
|
@@ -15,7 +15,7 @@ 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/e36ab29971eb4ccc0b5b4527f23dbb34bf590107/lib/appium_thor/helpers.rb#L18)
|
19
19
|
|
20
20
|
> def sh command
|
21
21
|
|
@@ -23,7 +23,7 @@ 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/e36ab29971eb4ccc0b5b4527f23dbb34bf590107/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/e36ab29971eb4ccc0b5b4527f23dbb34bf590107/lib/appium_thor/helpers.rb#L35)
|
35
35
|
|
36
36
|
> def version
|
37
37
|
|
@@ -39,7 +39,7 @@ 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/e36ab29971eb4ccc0b5b4527f23dbb34bf590107/lib/appium_thor/helpers.rb#L46)
|
43
43
|
|
44
44
|
> def _bump value
|
45
45
|
|
@@ -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/e36ab29971eb4ccc0b5b4527f23dbb34bf590107/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/e36ab29971eb4ccc0b5b4527f23dbb34bf590107/lib/appium_thor/helpers.rb#L141)
|
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/e36ab29971eb4ccc0b5b4527f23dbb34bf590107/lib/appium_thor/helpers.rb#L148)
|
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/e36ab29971eb4ccc0b5b4527f23dbb34bf590107/lib/appium_thor/helpers.rb#L159)
|
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/e36ab29971eb4ccc0b5b4527f23dbb34bf590107/lib/appium_thor/helpers.rb#L188)
|
100
100
|
|
101
101
|
> def remove_non_ascii_from_cwd
|
102
102
|
|
@@ -2,9 +2,10 @@
|
|
2
2
|
class Default < Thor
|
3
3
|
desc 'info', 'prints config info for this gem'
|
4
4
|
def info
|
5
|
-
puts "
|
6
|
-
"
|
7
|
-
"
|
5
|
+
puts " gem_name: #{gem_name}\n" +
|
6
|
+
" github_name: #{github_name}\n" +
|
7
|
+
" github_owner: #{github_owner}\n"
|
8
|
+
" version_file: #{version_file}"
|
8
9
|
end
|
9
10
|
|
10
11
|
desc 'bumpx', 'Bump the x version number, set y & z to zero, update the date.'
|
data/lib/appium_thor/config.rb
CHANGED
@@ -4,30 +4,19 @@ module Appium
|
|
4
4
|
include Singleton
|
5
5
|
|
6
6
|
# Returns true if all options are truthy
|
7
|
-
def
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
def init_and_validate
|
8
|
+
# set default values
|
9
|
+
if @gem_name
|
10
|
+
@github_name ||= @gem_name
|
11
|
+
@version_file ||= "lib/#{@gem_name}/version.rb"
|
12
|
+
end
|
11
13
|
|
12
|
-
|
13
|
-
# sets the option value to string
|
14
|
-
def gem_name string=nil
|
15
|
-
return @gem_name if @gem_name
|
16
|
-
@gem_name = string
|
17
|
-
end
|
18
|
-
|
19
|
-
# Returns option value if it's set otherwise
|
20
|
-
# sets the option value to string
|
21
|
-
def github_name string=nil
|
22
|
-
return @github_name if @github_name
|
23
|
-
@github_name = string
|
24
|
-
end
|
14
|
+
@github_owner ||= 'appium'
|
25
15
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
@version_file = string
|
16
|
+
# ensure all options are set
|
17
|
+
all_set = @gem_name && @github_name && @github_owner && @version_file
|
18
|
+
raise 'Must set gem_name, github_name, github_owner, version_file' unless all_set
|
19
|
+
raise "version file doesn't exist #{@version_file}" unless File.exist?(@version_file)
|
31
20
|
end
|
32
21
|
|
33
22
|
# block of code to execute that contains documentation
|
@@ -37,22 +26,37 @@ module Appium
|
|
37
26
|
@docs_block = block
|
38
27
|
end
|
39
28
|
|
40
|
-
# all
|
29
|
+
# Returns all options as symbols. Required for defining delegators in init.rb
|
41
30
|
def self.options
|
42
|
-
|
31
|
+
string_options + [:docs_block]
|
32
|
+
end
|
33
|
+
|
34
|
+
# the subset of options that operate on strings
|
35
|
+
def self.string_options
|
36
|
+
%w[gem_name github_name github_owner version_file].map(&:to_sym)
|
37
|
+
end
|
38
|
+
|
39
|
+
string_options.each do |option|
|
40
|
+
class_eval %Q(
|
41
|
+
def #{option} string=nil
|
42
|
+
return @#{option} if @#{option}
|
43
|
+
@#{option} = string
|
44
|
+
end
|
45
|
+
)
|
43
46
|
end
|
44
47
|
|
45
48
|
# Enables setting config in the Thorfile
|
46
49
|
#
|
47
50
|
# Appium::Thor::Config.set do
|
48
51
|
# gem_name 'appium_thor'
|
52
|
+
# github_owner 'appium'
|
49
53
|
# github_name 'appium_thor'
|
50
54
|
# version_file 'path/to/version.rb'
|
51
55
|
# end
|
52
56
|
def self.set &block
|
53
57
|
config = self.instance
|
54
58
|
config.instance_eval &block
|
55
|
-
config.
|
59
|
+
config.init_and_validate
|
56
60
|
config
|
57
61
|
end
|
58
62
|
end # module Config
|
data/lib/appium_thor/docs.rb
CHANGED
@@ -26,7 +26,7 @@ module Appium
|
|
26
26
|
|
27
27
|
method_path = obj.file.split('/lib/').last
|
28
28
|
os = method_path.downcase.match /ios|android/
|
29
|
-
out += "##### [#{obj.name.to_s}](https://github.com
|
29
|
+
out += "##### [#{obj.name.to_s}](https://github.com/#{github_owner}/#{github_name}/blob/#{last_sha}/lib/#{method_path}#L#{obj.line}) #{os}\n\n"
|
30
30
|
out += "> #{obj.signature}\n\n"
|
31
31
|
out += "#{obj.docstring}\n\n"
|
32
32
|
|
data/lib/appium_thor/helpers.rb
CHANGED
@@ -122,7 +122,7 @@ module Appium
|
|
122
122
|
# use first 7 chars to match GitHub
|
123
123
|
comment = line.gsub(hex, '').strip
|
124
124
|
next if comment == 'Update release notes'
|
125
|
-
new_data += "- [#{hex[0...7]}](https://github.com
|
125
|
+
new_data += "- [#{hex[0...7]}](https://github.com/#{github_owner}/#{github_name}/commit/#{hex}) #{comment}\n"
|
126
126
|
end
|
127
127
|
data = new_data + "\n"
|
128
128
|
|
data/lib/appium_thor/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Appium
|
2
2
|
module Thor
|
3
|
-
VERSION = '0.0.
|
4
|
-
DATE = '2014-
|
3
|
+
VERSION = '0.0.7' unless defined? ::Appium::Thor::VERSION
|
4
|
+
DATE = '2014-08-04' unless defined? ::Appium::Thor::DATE
|
5
5
|
end
|
6
6
|
end
|
data/release_notes.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
#### v0.0.7 2014-08-04
|
2
|
+
|
3
|
+
- [e36ab29](https://github.com/appium/appium_thor/commit/e36ab29971eb4ccc0b5b4527f23dbb34bf590107) Release 0.0.7
|
4
|
+
- [b7cc396](https://github.com/appium/appium_thor/commit/b7cc3965b33020e599e83188efafbd946472f728) Release 0.0.7
|
5
|
+
- [d8c695e](https://github.com/appium/appium_thor/commit/d8c695e344c2cddd315c644c0363176e01fac323) Fix delegators
|
6
|
+
- [a68604a](https://github.com/appium/appium_thor/commit/a68604a1f76827fb3b4b3fcbedd8a1eacc818005) Fix delegators
|
7
|
+
- [494e083](https://github.com/appium/appium_thor/commit/494e08359e8dcff04cf85d06b6a13ce6043f8c8b) Document default values
|
8
|
+
- [5085c84](https://github.com/appium/appium_thor/commit/5085c849829a770e34e7e1f2a70a1dba61ef229d) Add default values
|
9
|
+
- [2cea23d](https://github.com/appium/appium_thor/commit/2cea23dbc055006d17ceb8aef2f25341ea765aa4) Add github_owner
|
10
|
+
- [e117e5d](https://github.com/appium/appium_thor/commit/e117e5dead6c67a9dc47fbf697358d91246ad414) Update README.md
|
11
|
+
|
12
|
+
|
1
13
|
#### v0.0.6 2014-07-31
|
2
14
|
|
3
15
|
- [b6659a4](https://github.com/appium/appium_thor/commit/b6659a4ea55c99cf68707f75d02ef29062760a00) Release 0.0.6
|
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: 0.0.
|
4
|
+
version: 0.0.7
|
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: 2014-
|
11
|
+
date: 2014-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redcarpet
|