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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e1d4977cc37e98c4d0d7d03d77a9bb157c38496
4
- data.tar.gz: a3eda9dfdc24afc9d8345aeaa2a1868d67a56d17
3
+ metadata.gz: e6372f8af44a11dad4268ad67a726b44d32bf2d7
4
+ data.tar.gz: eda5f8cb4d3007d25731397529f37fda937526b4
5
5
  SHA512:
6
- metadata.gz: 970bdb8fc791ac3a320daceb61781948f85fd6cb1a39690a31adf0d67b371525d0816a2617fc7b3b125d16e1ba9f39c09f4226ec71c6b742e4c74f7ff9510493
7
- data.tar.gz: bdcf1529c52809cbf3e284bfee169d5b4e73f4722c5bfd2438797890928900600097c514e424025fa56fa3df6280474a2f0ebdef8319fb3d3dd095da678a3e54
6
+ metadata.gz: 9d2eca385582aff83247cbc5f32390f0bf6856662af095ddc0941880336bcdf64a4441538f3163ad133d7e439e76d4a5d23e3ceb05b72acb871732aa5be58036
7
+ data.tar.gz: 1ccaf39001af061b3a8677d2a45120458248101e770f0ae6ff781f996a51e0b0859d3be15fac743668645d9b73f8cb6bf8172d0d5d6e3dca134e4fb1a750cc71
@@ -1,4 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.0.0
3
4
  - 2.1.2
4
- before_install: gem install bundler -v 1.10.4
5
+ before_install:
6
+ - gem install bundler -v 1.10.4
data/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  Generate GitHub repository changelog.
4
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/octy.svg)](http://badge.fury.io/rb/octy)
6
+ [![Build Status](https://travis-ci.org/Kakakakakku/octy.svg)](https://travis-ci.org/Kakakakakku/octy)
7
+ [![Code Climate](https://codeclimate.com/github/Kakakakakku/octy/badges/gpa.svg)](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
- TODO: Write usage instructions here
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
-
@@ -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 'gen', 'Generate sample host name by mnemonic wordlist.'
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Octy
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-10 00:00:00.000000000 Z
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