glogin 0.4.7 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: a944ac6deb8753b6c83edcc20150d1974d96d1ea
4
- data.tar.gz: fea64b30eee967e25f461adad50dd9ed1923ad32
2
+ SHA256:
3
+ metadata.gz: 93a88ed241cce1fdcf74a5859047c843099d10bb1b7b3c07e8e9600d44669ac4
4
+ data.tar.gz: 462667452da75d4b13f29d11090bb2983f40291d0c804490152204e5d881a777
5
5
  SHA512:
6
- metadata.gz: a5e86b398154075886c5acedc521b6495e94ed65d78f1028193ae2f4b1e317c04009897f6a1d215c2d0159bf463528266b322a1d8cd1e246eae145d73b466f1e
7
- data.tar.gz: b3448c5973ee4e6d6facb5afea166dc452dea49f5f824cde571719af0f51d1673ecb4f14512cb76077e627072a020f503cf30a54c2035ea1877e3d4c5f6df83a
6
+ metadata.gz: 9ebdfe1dcab9305b49a9d91629dd9b1e92eb632bf6996f28f42ffd2125768183528f4b32c6114def32af57d59df6193f3daaaa652cc27ae8cf027e0105f44de3
7
+ data.tar.gz: 58b69076f5871372da3dd91ff9b6225283152746a2d66b283542dbcd7384e879b153bb38e95f1a1491aec5aafbef502e59c8501dffe5fd93c2e4a406165cbd2b
@@ -3,7 +3,7 @@ AllCops:
3
3
  - 'bin/**/*'
4
4
  - 'assets/**/*'
5
5
  DisplayCopNames: true
6
- TargetRubyVersion: 2.2
6
+ TargetRubyVersion: 2.3
7
7
 
8
8
  Metrics/MethodLength:
9
9
  Enabled: false
@@ -2,6 +2,8 @@ assets:
2
2
  rubygems.yml: zerocracy/home#assets/rubygems.yml
3
3
  s3cfg: zerocracy/home#assets/s3cfg
4
4
  install: |
5
+ export GEM_HOME=~/.ruby
6
+ export GEM_PATH=$GEM_HOME:$GEM_PATH
5
7
  sudo apt-get -y update
6
8
  sudo gem install pdd
7
9
  release:
data/.simplecov CHANGED
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2017-2018 Yegor Bugayenko
2
+ # Copyright (c) 2017-2019 Yegor Bugayenko
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the 'Software'), to deal
data/Gemfile CHANGED
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #
2
- # Copyright (c) 2017-2018 Yegor Bugayenko
4
+ # Copyright (c) 2017-2019 Yegor Bugayenko
3
5
  #
4
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
7
  # of this software and associated documentation files (the 'Software'), to deal
@@ -20,4 +22,5 @@
20
22
  # SOFTWARE.
21
23
 
22
24
  source 'https://rubygems.org'
25
+ ruby '~>2.3'
23
26
  gemspec
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2017-2018 Yegor Bugayenko
3
+ Copyright (c) 2017-2019 Yegor Bugayenko
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the 'Software'), to deal
data/README.md CHANGED
@@ -7,6 +7,7 @@
7
7
  [![Gem Version](https://badge.fury.io/rb/glogin.svg)](http://badge.fury.io/rb/glogin)
8
8
  [![Maintainability](https://api.codeclimate.com/v1/badges/155f86b639d155259219/maintainability)](https://codeclimate.com/github/yegor256/glogin/maintainability)
9
9
  [![Test Coverage](https://img.shields.io/codecov/c/github/yegor256/glogin.svg)](https://codecov.io/github/yegor256/glogin?branch=master)
10
+ [![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/github/yegor256/glogin/master/frames)
10
11
 
11
12
  ## GitHub Login for Ruby web app
12
13
 
@@ -131,15 +132,25 @@ encrypted = codec.encrypt('Hello, world!')
131
132
  decrypted = codec.decrypt(encrypted)
132
133
  ```
133
134
 
134
- ## How to contribute?
135
+ # How to contribute
135
136
 
136
- Just submit a pull request. Make sure `rake` passes.
137
+ Read [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
138
+ Make sure you build is green before you contribute
139
+ your pull request. You will need to have [Ruby](https://www.ruby-lang.org/en/) 2.3+ and
140
+ [Bundler](https://bundler.io/) installed. Then:
141
+
142
+ ```
143
+ $ bundle update
144
+ $ rake
145
+ ```
146
+
147
+ If it's clean and you don't see any error messages, submit your pull request.
137
148
 
138
149
  ## License
139
150
 
140
151
  (The MIT License)
141
152
 
142
- Copyright (c) 2017-2018 Yegor Bugayenko
153
+ Copyright (c) 2017-2019 Yegor Bugayenko
143
154
 
144
155
  Permission is hereby granted, free of charge, to any person obtaining a copy
145
156
  of this software and associated documentation files (the 'Software'), to deal
data/Rakefile CHANGED
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #
2
- # Copyright (c) 2017-2018 Yegor Bugayenko
4
+ # Copyright (c) 2017-2019 Yegor Bugayenko
3
5
  #
4
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
7
  # of this software and associated documentation files (the 'Software'), to deal
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #
2
- # Copyright (c) 2017-2018 Yegor Bugayenko
4
+ # Copyright (c) 2017-2019 Yegor Bugayenko
3
5
  #
4
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
7
  # of this software and associated documentation files (the 'Software'), to deal
@@ -31,7 +33,7 @@ Gem::Specification.new do |s|
31
33
  s.required_rubygems_version = Gem::Requirement.new('>= 0')
32
34
  end
33
35
  s.rubygems_version = '2.2'
34
- s.required_ruby_version = '~>2.2'
36
+ s.required_ruby_version = '~>2.3'
35
37
  s.name = 'glogin'
36
38
  s.version = GLogin::VERSION
37
39
  s.license = 'MIT'
@@ -45,12 +47,12 @@ Gem::Specification.new do |s|
45
47
  s.test_files = s.files.grep(%r{^(test)/})
46
48
  s.rdoc_options = ['--charset=UTF-8']
47
49
  s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
48
- s.add_development_dependency 'codecov', '~>0.1'
49
- s.add_development_dependency 'minitest', '~>5.5'
50
- s.add_development_dependency 'rake', '~>12.0'
51
- s.add_development_dependency 'rdoc', '~>4.2'
52
- s.add_development_dependency 'rspec-rails', '~>3.1'
53
- s.add_development_dependency 'rubocop', '~>0.57'
54
- s.add_development_dependency 'rubocop-rspec', '~>1.5'
55
- s.add_development_dependency 'webmock', '~>3.4'
50
+ s.add_development_dependency 'codecov', '0.1.14'
51
+ s.add_development_dependency 'minitest', '5.11.3'
52
+ s.add_development_dependency 'rake', '12.3.2'
53
+ s.add_development_dependency 'rdoc', '4.3.0'
54
+ s.add_development_dependency 'rspec-rails', '3.8.2'
55
+ s.add_development_dependency 'rubocop', '0.65.0'
56
+ s.add_development_dependency 'rubocop-rspec', '1.32.0'
57
+ s.add_development_dependency 'webmock', '3.5.1'
56
58
  end
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #
2
- # Copyright (c) 2017-2018 Yegor Bugayenko
4
+ # Copyright (c) 2017-2019 Yegor Bugayenko
3
5
  #
4
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
7
  # of this software and associated documentation files (the 'Software'), to deal
@@ -26,7 +28,7 @@ require_relative 'glogin/cookie'
26
28
 
27
29
  # GLogin main module.
28
30
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
29
- # Copyright:: Copyright (c) 2017-2018 Yegor Bugayenko
31
+ # Copyright:: Copyright (c) 2017-2019 Yegor Bugayenko
30
32
  # License:: MIT
31
33
  module GLogin
32
34
  end
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #
2
- # Copyright (c) 2017-2018 Yegor Bugayenko
4
+ # Copyright (c) 2017-2019 Yegor Bugayenko
3
5
  #
4
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
7
  # of this software and associated documentation files (the 'Software'), to deal
@@ -26,7 +28,7 @@ require 'cgi'
26
28
 
27
29
  # GLogin main module.
28
30
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
29
- # Copyright:: Copyright (c) 2017-2018 Yegor Bugayenko
31
+ # Copyright:: Copyright (c) 2017-2019 Yegor Bugayenko
30
32
  # License:: MIT
31
33
  module GLogin
32
34
  #
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #
2
- # Copyright (c) 2017-2018 Yegor Bugayenko
4
+ # Copyright (c) 2017-2019 Yegor Bugayenko
3
5
  #
4
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
7
  # of this software and associated documentation files (the 'Software'), to deal
@@ -26,7 +28,7 @@ require 'base64'
26
28
 
27
29
  # Codec.
28
30
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
29
- # Copyright:: Copyright (c) 2017-2018 Yegor Bugayenko
31
+ # Copyright:: Copyright (c) 2017-2019 Yegor Bugayenko
30
32
  # License:: MIT
31
33
  module GLogin
32
34
  #
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #
2
- # Copyright (c) 2017-2018 Yegor Bugayenko
4
+ # Copyright (c) 2017-2019 Yegor Bugayenko
3
5
  #
4
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
7
  # of this software and associated documentation files (the 'Software'), to deal
@@ -26,11 +28,11 @@ require_relative 'codec'
26
28
 
27
29
  # GLogin main module.
28
30
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
29
- # Copyright:: Copyright (c) 2017-2018 Yegor Bugayenko
31
+ # Copyright:: Copyright (c) 2017-2019 Yegor Bugayenko
30
32
  # License:: MIT
31
33
  module GLogin
32
34
  # Split symbol inside the cookie text
33
- SPLIT = '|'.freeze
35
+ SPLIT = '|'
34
36
 
35
37
  #
36
38
  # Secure cookie
@@ -75,12 +77,22 @@ module GLogin
75
77
  @context = context.to_s
76
78
  end
77
79
 
80
+ # GitHub login name of the authenticated user
81
+ def login
82
+ @json['login']
83
+ end
84
+
85
+ # GitHub avatar URL of the authenticated user
86
+ def avatar_url
87
+ @json['avatar_url']
88
+ end
89
+
78
90
  # Returns the text you should drop back to the user as a cookie.
79
91
  def to_s
80
92
  Codec.new(@secret).encrypt(
81
93
  [
82
- @json['login'],
83
- @json['avatar_url'],
94
+ login,
95
+ avatar_url,
84
96
  @json['bearer'],
85
97
  @context
86
98
  ].join(GLogin::SPLIT)
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #
2
- # Copyright (c) 2017-2018 Yegor Bugayenko
4
+ # Copyright (c) 2017-2019 Yegor Bugayenko
3
5
  #
4
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
7
  # of this software and associated documentation files (the 'Software'), to deal
@@ -21,8 +23,8 @@
21
23
 
22
24
  # GLogin main module.
23
25
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
24
- # Copyright:: Copyright (c) 2017-2018 Yegor Bugayenko
26
+ # Copyright:: Copyright (c) 2017-2019 Yegor Bugayenko
25
27
  # License:: MIT
26
28
  module GLogin
27
- VERSION = '0.4.7'.freeze
29
+ VERSION = '0.5.0'
28
30
  end
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #
2
- # Copyright (c) 2017-2018 Yegor Bugayenko
4
+ # Copyright (c) 2017-2019 Yegor Bugayenko
3
5
  #
4
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
7
  # of this software and associated documentation files (the 'Software'), to deal
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #
2
- # Copyright (c) 2017-2018 Yegor Bugayenko
4
+ # Copyright (c) 2017-2019 Yegor Bugayenko
3
5
  #
4
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
7
  # of this software and associated documentation files (the 'Software'), to deal
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #
2
- # Copyright (c) 2017-2018 Yegor Bugayenko
4
+ # Copyright (c) 2017-2019 Yegor Bugayenko
3
5
  #
4
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
7
  # of this software and associated documentation files (the 'Software'), to deal
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #
2
- # Copyright (c) 2017-2018 Yegor Bugayenko
4
+ # Copyright (c) 2017-2019 Yegor Bugayenko
3
5
  #
4
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
7
  # of this software and associated documentation files (the 'Software'), to deal
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #
2
- # Copyright (c) 2017-2018 Yegor Bugayenko
4
+ # Copyright (c) 2017-2019 Yegor Bugayenko
3
5
  #
4
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
7
  # of this software and associated documentation files (the 'Software'), to deal
@@ -24,7 +26,7 @@ require_relative '../lib/glogin'
24
26
 
25
27
  # GLogin main module test.
26
28
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
27
- # Copyright:: Copyright (c) 2017-2018 Yegor Bugayenko
29
+ # Copyright:: Copyright (c) 2017-2019 Yegor Bugayenko
28
30
  # License:: MIT
29
31
  class TestGLogin < Minitest::Test
30
32
  def test_basic
metadata CHANGED
@@ -1,127 +1,127 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glogin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-11 00:00:00.000000000 Z
11
+ date: 2019-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: codecov
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: '0.1'
19
+ version: 0.1.14
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: '0.1'
26
+ version: 0.1.14
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: '5.5'
33
+ version: 5.11.3
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: '5.5'
40
+ version: 5.11.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: '12.0'
47
+ version: 12.3.2
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: '12.0'
54
+ version: 12.3.2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rdoc
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: '4.2'
61
+ version: 4.3.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: '4.2'
68
+ version: 4.3.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec-rails
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: '3.1'
75
+ version: 3.8.2
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: '3.1'
82
+ version: 3.8.2
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rubocop
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: '0.57'
89
+ version: 0.65.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: '0.57'
96
+ version: 0.65.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rubocop-rspec
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: '1.5'
103
+ version: 1.32.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: '1.5'
110
+ version: 1.32.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: webmock
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: '3.4'
117
+ version: 3.5.1
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: '3.4'
124
+ version: 3.5.1
125
125
  description: Enables login/logout functionality for a Ruby web app
126
126
  email: yegor256@gmail.com
127
127
  executables: []
@@ -166,15 +166,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
166
166
  requirements:
167
167
  - - "~>"
168
168
  - !ruby/object:Gem::Version
169
- version: '2.2'
169
+ version: '2.3'
170
170
  required_rubygems_version: !ruby/object:Gem::Requirement
171
171
  requirements:
172
172
  - - ">="
173
173
  - !ruby/object:Gem::Version
174
174
  version: '0'
175
175
  requirements: []
176
- rubyforge_project:
177
- rubygems_version: 2.6.8
176
+ rubygems_version: 3.0.1
178
177
  signing_key:
179
178
  specification_version: 2
180
179
  summary: Login/logout via GitHub OAuth for your web app