github_issue_request 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e2f2401cee037387c241b871e0a13420df6d6c0d
4
+ data.tar.gz: 7742f45448db9f838e45cdd7997ce9738f350a45
5
+ SHA512:
6
+ metadata.gz: e51d387c1a077c132d8bd02a4e1afca6263835f7091054d46e122c0db20c1620c38aafbb40d2f32f93c9e4dcf9a542be7d89017ee1702256fb5e75d50755c391
7
+ data.tar.gz: e130647ba9603d94d3627a81b7174e34e3f62f97ad0aca9e9c67237fee1bc8742f71c5bb7669a2db820ee215ff25f9ce3d7f4fc5ce5462f3c71445cb5c4d99c3
data/.gitignore ADDED
@@ -0,0 +1,40 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ ## Specific to RubyMotion:
14
+ .dat*
15
+ .repl_history
16
+ build/
17
+
18
+ ## Documentation cache and generated files:
19
+ /.yardoc/
20
+ /_yardoc/
21
+ /doc/
22
+ /rdoc/
23
+
24
+ ## Environment normalisation:
25
+ /.bundle/
26
+ /vendor/bundle
27
+ /lib/bundler/man/
28
+
29
+ # for a library or gem, you might want to ignore these files since the code is
30
+ # intended to run in multiple environments; otherwise, check them in:
31
+ # Gemfile.lock
32
+ # .ruby-version
33
+ # .ruby-gemset
34
+
35
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
36
+ .rvmrc
37
+
38
+ # Intellij IDEA
39
+ .idea
40
+ *.iml
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in deploygate.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,48 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ GithubIssueRequest (0.0.1)
5
+ activesupport (~> 4.2.4)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ activesupport (4.2.4)
11
+ i18n (~> 0.7)
12
+ json (~> 1.7, >= 1.7.7)
13
+ minitest (~> 5.1)
14
+ thread_safe (~> 0.3, >= 0.3.4)
15
+ tzinfo (~> 1.1)
16
+ diff-lcs (1.2.5)
17
+ i18n (0.7.0)
18
+ json (1.8.3)
19
+ minitest (5.8.1)
20
+ rake (10.4.2)
21
+ rspec (3.3.0)
22
+ rspec-core (~> 3.3.0)
23
+ rspec-expectations (~> 3.3.0)
24
+ rspec-mocks (~> 3.3.0)
25
+ rspec-core (3.3.2)
26
+ rspec-support (~> 3.3.0)
27
+ rspec-expectations (3.3.1)
28
+ diff-lcs (>= 1.2.0, < 2.0)
29
+ rspec-support (~> 3.3.0)
30
+ rspec-mocks (3.3.2)
31
+ diff-lcs (>= 1.2.0, < 2.0)
32
+ rspec-support (~> 3.3.0)
33
+ rspec-support (3.3.0)
34
+ thread_safe (0.3.5)
35
+ tzinfo (1.2.2)
36
+ thread_safe (~> 0.1)
37
+
38
+ PLATFORMS
39
+ ruby
40
+
41
+ DEPENDENCIES
42
+ GithubIssueRequest!
43
+ bundler (~> 1.3)
44
+ rake
45
+ rspec (~> 3.3.0)
46
+
47
+ BUNDLED WITH
48
+ 1.10.6
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # Github issue request
2
+ [![Build Status](https://travis-ci.org/henteko/github_issue_request.svg?branch=master)](https://travis-ci.org/henteko/github_issue_request)
3
+ [![Gem Version](https://badge.fury.io/rb/GithubIssueRequest.svg)](https://badge.fury.io/rb/GithubIssueRequest)
4
+
5
+ This gem is request to github issue for user.
6
+
7
+ # Install
8
+
9
+ ```
10
+ $ gem install GithubIssueRequest
11
+ ```
12
+
13
+ or
14
+
15
+ ```
16
+ gem 'GithubIssueRequest'
17
+ ```
18
+
19
+ ```
20
+ $ bundle install
21
+ ```
22
+
23
+ # Use
24
+
25
+ ```
26
+ require 'github_issue_request'
27
+
28
+ GithubIssueRequest::Url.config('owner_name', 'repo_name')
29
+
30
+ options = {
31
+ :title => 'issue title',
32
+ :body => 'issue body text',
33
+ :labels => ['bug', 'WIP']
34
+ }
35
+ request_url = GithubIssueRequest::Url.new(options)
36
+
37
+ request.to_s # get issue request url
38
+ ```
39
+
40
+ # License
41
+ MIT
data/Rakefile ADDED
@@ -0,0 +1,5 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+ task default: :spec
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'github_issue_request/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "github_issue_request"
8
+ spec.version = GithubIssueRequest::VERSION
9
+ spec.authors = ["henteko"]
10
+ spec.email = ["henteko07@gmail.com"]
11
+ spec.description = %q{Create request github issue}
12
+ spec.summary = %q{User create request github issue}
13
+ spec.homepage = "https://github.com/henteko/github_issue_request"
14
+ spec.license = "MIT"
15
+
16
+ spec.add_dependency "activesupport", "~> 4.2.4"
17
+
18
+ spec.add_development_dependency "bundler", "~> 1.3"
19
+ spec.add_development_dependency "rake"
20
+ spec.add_development_dependency "rspec", "~> 3.3.0"
21
+
22
+ spec.files = `git ls-files`.split($/)
23
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
24
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
25
+ spec.require_paths = ["lib"]
26
+ end
@@ -0,0 +1,8 @@
1
+ require "active_support/core_ext/hash"
2
+
3
+ module GithubIssueRequest
4
+ class NotSetOwnerRepoError < StandardError
5
+ end
6
+ end
7
+
8
+ require "github_issue_request/url"
@@ -0,0 +1,33 @@
1
+ module GithubIssueRequest
2
+ class Url
3
+ GITHUB_BASE_URL = "https://github.com"
4
+
5
+ class << self
6
+ def config(owner, repo)
7
+ @@owner = owner
8
+ @@repo = repo
9
+ end
10
+ end
11
+
12
+ # @param [Hash] options
13
+ # @return [GithubIssueRequest::Url]
14
+ def initialize(options = {})
15
+ _options = options.dup
16
+
17
+ owner = _options.delete(:owner)
18
+ repo = _options.delete(:repo)
19
+ @owner = owner || @@owner
20
+ @repo = repo || @@repo
21
+ @options = _options
22
+ raise NotSetOwnerRepoError if @owner.nil? || @repo.nil?
23
+
24
+ @url = "#{GITHUB_BASE_URL}/#{@owner}/#{@repo}/issues/new"
25
+ @url += "?#{@options.to_query}" unless _options.empty?
26
+ end
27
+
28
+ # @return [String]
29
+ def to_s
30
+ @url
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,3 @@
1
+ module GithubIssueRequest
2
+ VERSION = "0.0.2"
3
+ end
@@ -0,0 +1,66 @@
1
+ describe GithubIssueRequest::Url do
2
+ let(:owner_name) {'owner'}
3
+ let(:repo_name) {'repo'}
4
+
5
+ after(:example) do
6
+ # clean
7
+ GithubIssueRequest::Url.config(nil, nil)
8
+ end
9
+
10
+ context "no option" do
11
+ before do
12
+ GithubIssueRequest::Url.config(owner_name, repo_name)
13
+ end
14
+
15
+ it "default" do
16
+ request = GithubIssueRequest::Url.new
17
+ expect(request.to_s).to eq "https://github.com/#{owner_name}/#{repo_name}/issues/new"
18
+ end
19
+
20
+ it "change owner and repo name" do
21
+ options = {
22
+ :owner => 'change_owner',
23
+ :repo => 'change_repo'
24
+ }
25
+ request = GithubIssueRequest::Url.new(options)
26
+ expect(request.to_s).to eq "https://github.com/#{options[:owner]}/#{options[:repo]}/issues/new"
27
+ end
28
+ end
29
+
30
+ context "add options" do
31
+ let(:title) {'title'}
32
+ let(:body) {'body'}
33
+ let(:labels) {['bug', 'invalid']}
34
+
35
+ before do
36
+ GithubIssueRequest::Url.config(owner_name, repo_name)
37
+ end
38
+
39
+ it "add title, body, labels" do
40
+ options = {
41
+ :title => title,
42
+ :body => body,
43
+ :labels => labels
44
+ }
45
+ request = GithubIssueRequest::Url.new(options)
46
+ expect(request.to_s).to eq "https://github.com/#{owner_name}/#{repo_name}/issues/new?#{options.to_query}"
47
+ end
48
+ end
49
+
50
+ context "not set config" do
51
+ it "raise error" do
52
+ expect {
53
+ GithubIssueRequest::Url.new
54
+ }.to raise_error GithubIssueRequest::NotSetOwnerRepoError
55
+ end
56
+
57
+ it "not raise error" do
58
+ options = {
59
+ :owner => 'change_owner',
60
+ :repo => 'change_repo'
61
+ }
62
+ request = GithubIssueRequest::Url.new(options)
63
+ expect(request.to_s).to eq "https://github.com/#{options[:owner]}/#{options[:repo]}/issues/new"
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,4 @@
1
+ require "github_issue_request"
2
+
3
+ RSpec.configure do |config|
4
+ end
metadata ADDED
@@ -0,0 +1,115 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: github_issue_request
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - henteko
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-10-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 4.2.4
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 4.2.4
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 3.3.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 3.3.0
69
+ description: Create request github issue
70
+ email:
71
+ - henteko07@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".rspec"
78
+ - ".travis.yml"
79
+ - Gemfile
80
+ - Gemfile.lock
81
+ - README.md
82
+ - Rakefile
83
+ - github_issue_request.gemspec
84
+ - lib/github_issue_request.rb
85
+ - lib/github_issue_request/url.rb
86
+ - lib/github_issue_request/version.rb
87
+ - spec/github_issue_request/url_spec.rb
88
+ - spec/spec_helper.rb
89
+ homepage: https://github.com/henteko/github_issue_request
90
+ licenses:
91
+ - MIT
92
+ metadata: {}
93
+ post_install_message:
94
+ rdoc_options: []
95
+ require_paths:
96
+ - lib
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ requirements: []
108
+ rubyforge_project:
109
+ rubygems_version: 2.4.5
110
+ signing_key:
111
+ specification_version: 4
112
+ summary: User create request github issue
113
+ test_files:
114
+ - spec/github_issue_request/url_spec.rb
115
+ - spec/spec_helper.rb