appium_thor 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/appium_thor.gemspec +1 -1
- data/lib/appium_thor/commands/commands.rb +1 -3
- data/lib/appium_thor/helpers.rb +28 -5
- data/lib/appium_thor/version.rb +1 -1
- data/lib/appium_thor.rb +5 -5
- data/release_notes.md +8 -0
- metadata +7 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75d1d0f080406f2da8c05f39343a93e947a8174d
|
4
|
+
data.tar.gz: 87516acc6dec119bae6364d6830ec09c3fd85cc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d82c5278ead5cb6df2e4ff2e7659b13446f690e4d4e1938cc0f2e7096564e7310e74b60dfad87639c62e3b2976056b63ff331a929450924fc18fa4912f497af1
|
7
|
+
data.tar.gz: 8936f8d2a5d79ce40bf3b4c8d1ad02cea21f9598bd1259b1f7e243fc3e7c555ebe7cce4c35823f77351009850762f56a8aeae663e2313935be3601e40504501a
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
# appium_thor
|
1
|
+
# appium_thor [![Gem Version](https://badge.fury.io/rb/appium_thor.svg)](http://badge.fury.io/rb/appium_thor)[![Dependency Status](https://gemnasium.com/appium/appium_thor.svg)](https://gemnasium.com/appium/appium_thor)
|
2
|
+
|
2
3
|
|
3
4
|
Appium Thor helpers for appium's gems (appium_lib, appium_capybara)
|
4
5
|
|
@@ -30,4 +31,4 @@ thor notes # Update release notes
|
|
30
31
|
thor publish # Build and release a new gem to rubygems.org (same as rele...
|
31
32
|
thor release # Build and release a new gem to rubygems.org
|
32
33
|
thor uninstall # Uninstall gem
|
33
|
-
```
|
34
|
+
```
|
data/appium_thor.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.homepage = 'https://github.com/appium/appium_thor'
|
15
15
|
s.require_paths = ['lib']
|
16
16
|
|
17
|
-
s.add_runtime_dependency 'redcarpet', '~> 3.1.2'
|
17
|
+
s.add_runtime_dependency 'redcarpet', '~> 3.1', '>= 3.1.2'
|
18
18
|
s.add_runtime_dependency 'posix-spawn', '~> 0.3', '>= 0.3.8'
|
19
19
|
s.add_runtime_dependency 'yard', '~> 0.8', '>= 0.8.7.4'
|
20
20
|
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require_relative 'init'
|
2
|
-
|
3
1
|
# Define Thor tasks in the top level Default namespace.
|
4
2
|
class Default < Thor
|
5
3
|
desc 'info', 'prints config info for this gem'
|
@@ -63,7 +61,7 @@ class Default < Thor
|
|
63
61
|
update_release_notes
|
64
62
|
end
|
65
63
|
|
66
|
-
desc 'byte', 'Remove non-ascii bytes'
|
64
|
+
desc 'byte', 'Remove non-ascii bytes from all *.rb files in the current dir'
|
67
65
|
def byte
|
68
66
|
remove_non_ascii_from_cwd
|
69
67
|
end
|
data/lib/appium_thor/helpers.rb
CHANGED
@@ -1,16 +1,20 @@
|
|
1
1
|
module Appium
|
2
2
|
module Thor
|
3
3
|
module Helpers
|
4
|
+
# Sets the permissions on the gem credentials
|
5
|
+
# Runs gem build gemspec
|
4
6
|
def _build_gem
|
5
7
|
`chmod 0600 ~/.gem/credentials`
|
6
8
|
sh "gem build #{gem_name}.gemspec"
|
7
9
|
end
|
8
10
|
|
11
|
+
# Returns true if the tag exists on the master branch.
|
9
12
|
def tag_exists tag_name
|
10
13
|
cmd = %Q(git branch -a --contains "#{tag_name}")
|
11
14
|
POSIX::Spawn::Child.new(cmd).out.include? '* master'
|
12
15
|
end
|
13
16
|
|
17
|
+
# Runs command. Raises an exception if the command doesn't execute successfully.
|
14
18
|
def sh command
|
15
19
|
process = POSIX::Spawn::Child.new command
|
16
20
|
|
@@ -22,14 +26,23 @@ module Appium
|
|
22
26
|
out ? out.strip : out
|
23
27
|
end
|
24
28
|
|
29
|
+
# Used to parse the version number from version_file
|
25
30
|
def version_rgx
|
26
31
|
/\s*VERSION\s*=\s*'([^']+)'/m
|
27
32
|
end
|
28
33
|
|
34
|
+
# Returns the version number from version_file as a string
|
29
35
|
def version
|
30
36
|
@version ||= File.read(version_file).match(version_rgx)[1]
|
31
37
|
end
|
32
38
|
|
39
|
+
# Updates the date and version in version_file.
|
40
|
+
# Prints the new version and date to the console.
|
41
|
+
# The date is not printed if it hasn't changed.
|
42
|
+
#
|
43
|
+
# x.y.z
|
44
|
+
#
|
45
|
+
# @param value [symbol] value is either :x, :y, or :z. Default is z.
|
33
46
|
def _bump value
|
34
47
|
data = File.read version_file
|
35
48
|
|
@@ -68,6 +81,8 @@ module Appium
|
|
68
81
|
File.write version_file, data
|
69
82
|
end
|
70
83
|
|
84
|
+
# Creates release_notes.md based on changes between tags.
|
85
|
+
# Note that the first tag won't contain notes.
|
71
86
|
def update_release_notes
|
72
87
|
tag_sort = ->(tag1, tag2) do
|
73
88
|
tag1_numbers = tag1.match(/\.?v(\d+\.\d+\.\d+)$/)[1].split('.').map! { |n| n.to_i }
|
@@ -118,21 +133,29 @@ module Appium
|
|
118
133
|
File.open('release_notes.md', 'w') { |f| f.write notes.to_s.strip }
|
119
134
|
end
|
120
135
|
|
136
|
+
# Installs the local gem. It's fast due to the flags
|
137
|
+
#
|
138
|
+
# --no-rdoc = skip rdoc
|
139
|
+
# --no-ri = skip ri
|
140
|
+
# --local = only install from the local disk
|
121
141
|
def _install
|
122
142
|
_build_gem
|
123
143
|
_uninstall
|
124
144
|
sh "gem install --no-rdoc --no-ri --local #{gem_name}-#{version}.gem"
|
125
145
|
end
|
126
146
|
|
147
|
+
# Uninstalls all versions of the gem
|
127
148
|
def _uninstall
|
128
149
|
cmd = "gem uninstall -aIx #{gem_name}"
|
129
|
-
# rescue
|
130
|
-
|
131
|
-
sh "#{cmd}"
|
132
|
-
rescue
|
133
|
-
end
|
150
|
+
# rescue from errors. avoids gem not installed error.
|
151
|
+
sh "#{cmd}" rescue nil
|
134
152
|
end
|
135
153
|
|
154
|
+
# Publishes the master branch to github
|
155
|
+
# Creates a version tag
|
156
|
+
# Updates release notes and documentation
|
157
|
+
# Builds the gem
|
158
|
+
# Publishes the gem to rubygems
|
136
159
|
def _publish
|
137
160
|
unless `git branch`.include? '* master'
|
138
161
|
puts 'Master branch required to release.'
|
data/lib/appium_thor/version.rb
CHANGED
data/lib/appium_thor.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
# stdlib
|
2
|
-
|
3
2
|
require 'forwardable' # commands.rb
|
4
3
|
require 'singleton' # config.rb
|
5
4
|
|
6
5
|
# gems
|
7
6
|
require 'rubygems'
|
8
|
-
require 'yard'
|
9
|
-
require 'posix-spawn'
|
10
|
-
require 'date'
|
7
|
+
require 'yard' # docs.rb
|
8
|
+
require 'posix-spawn' # helpers.rb
|
9
|
+
require 'date' # helpers.rb Date.today
|
11
10
|
|
11
|
+
# internal
|
12
12
|
require_relative 'appium_thor/docs'
|
13
13
|
require_relative 'appium_thor/helpers'
|
14
14
|
require_relative 'appium_thor/version'
|
15
|
-
|
16
15
|
require_relative 'appium_thor/config'
|
16
|
+
require_relative 'appium_thor/commands/init'
|
17
17
|
require_relative 'appium_thor/commands/commands'
|
data/release_notes.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
#### v0.0.5 2014-07-31
|
2
|
+
|
3
|
+
- [1934e8f](https://github.com/appium/appium_thor/commit/1934e8f05cf7eb9b2c8e0da76eb1ebb895511f2f) Release 0.0.5
|
4
|
+
- [a590195](https://github.com/appium/appium_thor/commit/a59019548b4b3e64209b3f04fc8a21e93068c789) Fix warning gem build appium_thor.gemspec
|
5
|
+
- [668958d](https://github.com/appium/appium_thor/commit/668958df039878e0b71ab2e74f1b1836510264d7) Document the commands
|
6
|
+
- [b30c703](https://github.com/appium/appium_thor/commit/b30c703152ac02e8774ad30bf404982fbb62c567) Add badge fury and gemnasium to readme
|
7
|
+
|
8
|
+
|
1
9
|
#### v0.0.4 2014-07-31
|
2
10
|
|
3
11
|
- [b0f4217](https://github.com/appium/appium_thor/commit/b0f42170c7b7df3befa9651647ea8c65ecd86710) Release 0.0.4
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- code@bootstraponline.com
|
@@ -15,6 +15,9 @@ dependencies:
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.1'
|
20
|
+
- - ">="
|
18
21
|
- !ruby/object:Gem::Version
|
19
22
|
version: 3.1.2
|
20
23
|
type: :runtime
|
@@ -22,6 +25,9 @@ dependencies:
|
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.1'
|
30
|
+
- - ">="
|
25
31
|
- !ruby/object:Gem::Version
|
26
32
|
version: 3.1.2
|
27
33
|
- !ruby/object:Gem::Dependency
|