octy 0.1.0 → 0.1.1
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/.travis.yml +3 -1
- data/README.md +11 -3
- data/lib/octy/cli.rb +6 -1
- data/lib/octy/error.rb +15 -0
- data/lib/octy/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6372f8af44a11dad4268ad67a726b44d32bf2d7
|
4
|
+
data.tar.gz: eda5f8cb4d3007d25731397529f37fda937526b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d2eca385582aff83247cbc5f32390f0bf6856662af095ddc0941880336bcdf64a4441538f3163ad133d7e439e76d4a5d23e3ceb05b72acb871732aa5be58036
|
7
|
+
data.tar.gz: 1ccaf39001af061b3a8677d2a45120458248101e770f0ae6ff781f996a51e0b0859d3be15fac743668645d9b73f8cb6bf8172d0d5d6e3dca134e4fb1a750cc71
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
Generate GitHub repository changelog.
|
4
4
|
|
5
|
+
[](http://badge.fury.io/rb/octy)
|
6
|
+
[](https://travis-ci.org/Kakakakakku/octy)
|
7
|
+
[](https://codeclimate.com/github/Kakakakakku/octy)
|
8
|
+
|
5
9
|
## Installation
|
6
10
|
|
7
11
|
Add this line to your application's Gemfile:
|
@@ -20,7 +24,13 @@ Or install it yourself as:
|
|
20
24
|
|
21
25
|
## Usage
|
22
26
|
|
23
|
-
|
27
|
+
Set GitHub access token.
|
28
|
+
|
29
|
+
$ export GITHUB_ACCESS_TOKEN=xxx
|
30
|
+
|
31
|
+
Exec one liner.
|
32
|
+
|
33
|
+
$ octy changelog --repo ${user/repo} --from {branch/tag} --to {branch/tag}
|
24
34
|
|
25
35
|
## Development
|
26
36
|
|
@@ -32,8 +42,6 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
42
|
|
33
43
|
Bug reports and pull requests are welcome on GitHub at https://github.com/Kakakakakku/octy.
|
34
44
|
|
35
|
-
|
36
45
|
## License
|
37
46
|
|
38
47
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
39
|
-
|
data/lib/octy/cli.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
require 'thor'
|
2
2
|
require 'octokit'
|
3
3
|
require 'octy/core'
|
4
|
+
require 'octy/error'
|
4
5
|
|
5
6
|
module Octy
|
6
7
|
|
7
8
|
class CLI < Thor
|
8
9
|
|
9
|
-
desc '
|
10
|
+
desc 'changelog', 'Generate GitHub repository changelog'
|
10
11
|
method_options repo: :string
|
11
12
|
method_options from: :string
|
12
13
|
method_options to: :string
|
@@ -15,6 +16,10 @@ module Octy
|
|
15
16
|
begin
|
16
17
|
octy = Octy::Core.new
|
17
18
|
octy.changelog(options[:repo], options[:from], options[:to])
|
19
|
+
rescue Octokit::Unauthorized
|
20
|
+
raise Octy::InvalidAccessTokenError
|
21
|
+
rescue Octokit::NotFound
|
22
|
+
raise Octy::InvalidResourceError
|
18
23
|
rescue => e
|
19
24
|
puts e.message
|
20
25
|
end
|
data/lib/octy/error.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
module Octy
|
2
|
+
|
3
|
+
class InvalidAccessTokenError < StandardError
|
4
|
+
def initialize
|
5
|
+
super('Invalid access token provided')
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class InvalidResourceError < StandardError
|
10
|
+
def initialize
|
11
|
+
super('Invalid resource (repository, branch, tag) given')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
data/lib/octy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kakakakakku
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -101,6 +101,7 @@ files:
|
|
101
101
|
- lib/octy.rb
|
102
102
|
- lib/octy/cli.rb
|
103
103
|
- lib/octy/core.rb
|
104
|
+
- lib/octy/error.rb
|
104
105
|
- lib/octy/printer.rb
|
105
106
|
- lib/octy/version.rb
|
106
107
|
- octy.gemspec
|