basic_auth_mark 0.1.0 → 0.2.0

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: b2abf3c18b8f658f8a7f7cdece883a2dc7e8b3a9
4
- data.tar.gz: 142fd71d74eae229c6026312d2f0fd6b91483266
3
+ metadata.gz: 4a065ee9ed62c4fc94e3ddc1bb9a4f46e5d7e9e4
4
+ data.tar.gz: 1aec11414b421ed299ab32351d182e3297aadd5e
5
5
  SHA512:
6
- metadata.gz: 091f6db80e37bf312431c2313438f7aa3efb768dd1a52455214071340b29d7edf428c1a6eb124439ca12317cca86b917808c4c0a28af05441623c4a59ff120d5
7
- data.tar.gz: e82ff03b4af82c064ae15d3609f755d89dad000f2f02f5cfc9b554ba99c7dfb221d69a0dcdf5fb5356235607fb79f027d796fae786cae039ed8fe976c18a6b45
6
+ metadata.gz: dd9f3102fa0ec404c47b7696cc62175aa0c6652a75b277c8ac4c6f760272648f0e63e0593773d21e394a4d39a8a2c11af1e0678ee6e9e5b16a103f3d938f5437
7
+ data.tar.gz: 1d11ed30c450aadf5c65de7b7302ab2d9966871d9dc6ef20bff1dea62c276bfdcd88c5523a7b4094450f9678c451c191d550ca95bcf5f574e81f1427ac3d8265
data/README.md CHANGED
@@ -1,23 +1,25 @@
1
1
  # BasicAuthMark
2
- Show Github Ribbon when you use Basic Authenticaiton.
2
+ Check whether HTTP Basic authentication is enabled or not.
3
+ if basic authenticaiton is enabled, show github ribbon on your page.
3
4
 
4
5
  ## Installation
5
6
 
6
- ### Rails App
7
+ ### Rails app
7
8
  All you have to do is to include the Gem
8
9
  ```ruby
9
10
  gem "basic_auth_mark"
10
11
  ```
11
12
 
12
13
  ## Configuring
13
- ### Change Ribbon Position
14
- #### Rails App
14
+ ### Rails app
15
15
  In `config/environments/#{environment}.rb`
16
16
 
17
17
  ```ruby
18
18
  Rails.application.configure do
19
- # ...
19
+ # change ribbon position(default:right-top)
20
20
  config.basic_auth_mark.position = 'left-bottom' # left-top/right-top/left-bottom/right-bottom
21
+ # change color(default: 880000)
22
+ config.basic_auth_mark.color = '0000aa'
21
23
  end
22
24
  ```
23
25
 
@@ -7,9 +7,11 @@ module BasicAuthMark
7
7
 
8
8
  def insert_into(html)
9
9
  position = BasicAuthMark.position
10
+ color = BasicAuthMark.color
10
11
 
11
12
  style_tag_str = <<-EOS
12
13
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.2/gh-fork-ribbon.min.css" />
14
+ <style>.github-fork-ribbon:before { background-color: ##{color};}</style>
13
15
  EOS
14
16
 
15
17
  div_tag_str = <<-EOS
@@ -11,6 +11,7 @@ module BasicAuthMark
11
11
  config.after_initialize do
12
12
  options = config.basic_auth_mark
13
13
  BasicAuthMark.position = options.position if options.position
14
+ BasicAuthMark.color = options.color if options.color
14
15
  end
15
16
  end
16
17
  end
@@ -1,3 +1,3 @@
1
1
  module BasicAuthMark
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -13,5 +13,13 @@ module BasicAuthMark
13
13
  def position=(position)
14
14
  @position = position
15
15
  end
16
+
17
+ def color
18
+ @color ||= '880000'
19
+ end
20
+
21
+ def color=(color)
22
+ @color = color
23
+ end
16
24
  end
17
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: basic_auth_mark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kazuki ozawa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-03 00:00:00.000000000 Z
11
+ date: 2019-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack