kanoko 0.0.1 → 0.0.2

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: 4136c44dd096d3ec43f5f699ed6479c17fa4e4d1
4
- data.tar.gz: 948b66876485aae4a6bfd43454d45efb0afc2d4e
3
+ metadata.gz: 2549a6bdda23d33eb4cded2c73a8a4404a5fd017
4
+ data.tar.gz: 36ecc1c7d224edbf0c3b82ecd3d8967da52ef741
5
5
  SHA512:
6
- metadata.gz: 302f15f1eb1d3cabf61cadb48bc98fb951e3eea4d3e886cf348d6917e4f879bb413e1c8560bbd3f41e0c996cc50e5f19070fab6591afed1fb4e041806e9903c8
7
- data.tar.gz: 5614f54f60f066149da8a40fd17c72716db1e0f4676d3efba6b67db877e1008db2faca37306f4d7ebd0d00c26ee94a6747f1875a493f80922e0f3e63a03796ed
6
+ metadata.gz: ba78d7bd762e23ad896a6b0559d5c98dc86e13ca8d82508b19341d6c00712fcc176a7b5c4acc9a9217687782199fab70af08d8be3e0c83f2af8f5205393bb61c
7
+ data.tar.gz: 500b00d0fcda53eba841fd2903bd9038d294c1ba21d8e420470c8f3c0bd80adb72b83a166086a8c42fe949902f88c7392657045fa42b6d811ac6b231a511430e
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  pkg/
2
2
  tmp/
3
+ Gemfile.lock
@@ -3,7 +3,7 @@ require 'kanoko/configure'
3
3
 
4
4
  module Kanoko
5
5
  # example:
6
- # Kanoko.configure.resource_host = "http://example.com"
6
+ # Kanoko.configure.kanoko_host = "http://example.com"
7
7
  # p Kanoko.configure #=> #<Kanoko::Configure ...>
8
8
  def configure
9
9
  @configure ||= Configure.new
@@ -15,10 +15,10 @@ module Kanoko
15
15
  end
16
16
 
17
17
  def url_for(func, args, src)
18
- if configure.resource_host.nil?
19
- fail ConfigureError, "`resource_host' must be set"
18
+ if configure.kanoko_host.nil?
19
+ fail ConfigureError, "`kanoko_host' must be set"
20
20
  end
21
- "#{configure.resource_host}#{make_path(func, args, src)}"
21
+ "#{configure.kanoko_host}#{make_path(func, args, src)}"
22
22
  end
23
23
  module_function :url_for
24
24
 
@@ -6,20 +6,20 @@ module Kanoko
6
6
  class Configure
7
7
  attr_accessor :digest_func, :secret_key, :hash_proc
8
8
 
9
- # resource_host expect String
9
+ # kanoko_host expect String
10
10
  # digest_func expect String
11
11
  # secret_key expect String
12
12
  # hash_proc expect Proc
13
13
  #
14
14
  # example:
15
15
  # Kanoko.configure.tap do |c|
16
- # c.resource_host = "http://example.com"
16
+ # c.kanoko_host = "http://example.com"
17
17
  # c.digest_func = "sha1"
18
18
  # c.secret_key = "secret"
19
19
  # end
20
20
  # Kanoko.url_for(:resize, "100x100") #=> "http://example.com/.../.../..."
21
21
  def initialize
22
- @resource_host = nil
22
+ @kanoko_host = nil
23
23
  @digest_func = nil
24
24
  @secret_key = nil
25
25
  @hash_proc = ->(*args){
@@ -34,12 +34,12 @@ module Kanoko
34
34
  }
35
35
  end
36
36
 
37
- def resource_host=(host)
38
- @resource_host = normalize_url(host)
37
+ def kanoko_host=(host)
38
+ @kanoko_host = normalize_url(host)
39
39
  end
40
40
 
41
- def resource_host
42
- @resource_host
41
+ def kanoko_host
42
+ @kanoko_host
43
43
  end
44
44
 
45
45
  private
@@ -53,7 +53,7 @@ module Kanoko
53
53
  when %r{\A//}
54
54
  "http:#{host}"
55
55
  else
56
- fail ConfigureError, "invalid resource_host `#{host}'"
56
+ fail ConfigureError, "invalid kanoko_host `#{host}'"
57
57
  end
58
58
  end
59
59
  end
@@ -1,3 +1,3 @@
1
1
  module Kanoko
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -6,17 +6,17 @@ class TestKanokoConfigure < Minitest::Test
6
6
  @config = Kanoko::Configure.new
7
7
  end
8
8
 
9
- def test_resource_host
10
- assert_raises(Kanoko::ConfigureError) { @config.resource_host = "/example.com" }
9
+ def test_kanoko_host
10
+ assert_raises(Kanoko::ConfigureError) { @config.kanoko_host = "/example.com" }
11
11
 
12
- @config.resource_host = "example.com"
13
- assert_equal "http://example.com", @config.resource_host
12
+ @config.kanoko_host = "example.com"
13
+ assert_equal "http://example.com", @config.kanoko_host
14
14
 
15
- @config.resource_host = "http://example.com"
16
- assert_equal "http://example.com", @config.resource_host
15
+ @config.kanoko_host = "http://example.com"
16
+ assert_equal "http://example.com", @config.kanoko_host
17
17
 
18
- @config.resource_host = "https://example.com"
19
- assert_equal "https://example.com", @config.resource_host
18
+ @config.kanoko_host = "https://example.com"
19
+ assert_equal "https://example.com", @config.kanoko_host
20
20
  end
21
21
 
22
22
  def test_hash_proc_by_default_error
@@ -5,7 +5,7 @@ class TestKanoko < Minitest::Test
5
5
  def setup
6
6
  Kanoko.configure.digest_func = "sha1"
7
7
  Kanoko.configure.secret_key = "test"
8
- Kanoko.configure.resource_host = "http://example.com"
8
+ Kanoko.configure.kanoko_host = "http://example.com"
9
9
  end
10
10
 
11
11
  def change_hash_proc(hash_proc)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kanoko
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ksss
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-07 00:00:00.000000000 Z
11
+ date: 2015-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -61,7 +61,6 @@ extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
63
  - Gemfile
64
- - Gemfile.lock
65
64
  - LICENSE.txt
66
65
  - Rakefile
67
66
  - kanoko.gemspec
@@ -1,19 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- kanoko (0.0.1)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- minitest (5.6.1)
10
- rake (10.4.2)
11
-
12
- PLATFORMS
13
- ruby
14
-
15
- DEPENDENCIES
16
- bundler
17
- kanoko!
18
- minitest
19
- rake