n_cipher 0.3.3 → 0.3.4

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: 6cd9e5cbf7ec143b9aac22c1196d8b9be2ef545a
4
- data.tar.gz: b3a5a4a267f19bbcad97dc265093fc09e6eda655
3
+ metadata.gz: 80265f86091eec640ccb6b3e661105a67c1cf8d1
4
+ data.tar.gz: e1010ee33a1b842e8ea787cbb85b80985ed6be0b
5
5
  SHA512:
6
- metadata.gz: 0178ed07ced51ac08b25f24609a0df49974d2ae817ab19edf148d387d9b00281a930cb98a0f90ff16d6c77ad61a64351d62f838bf1e2a3d55f75a2139a13ba05
7
- data.tar.gz: 2722748a052d5cc3c7c691ac17f27e7943b9cf5b0953aeb1aa1bae8b5388bf655625b480b375fd9daf046be29051e994e773e244f814b7a36405682cf8fbfcf4
6
+ metadata.gz: 68ebf9aa789276fcbad2bb431f619cc3872e5ce6eceaaa865d1a234b059a9081837463294770509c972ddde4ca38f3ebefb0f3437ef59e3dd22f777ec3583ef2
7
+ data.tar.gz: f4e86dfdf1161bc516f60479015ca2f1997e355afbe856c63908fa83ff68c970f603ea7824a6442c9ffb1e9aead9a84ad8d798931e239248219e0ac046006b82
data/.rubocop.yml ADDED
@@ -0,0 +1,17 @@
1
+ Style/AsciiComments:
2
+ Enabled: false
3
+ Style/Documentation:
4
+ Enabled: false
5
+ Style/SpaceInsideBlockBraces:
6
+ Enabled: false
7
+ Style/SpaceInsideHashLiteralBraces:
8
+ Enabled: false
9
+ Style/ColonMethodCall:
10
+ Enabled: false
11
+ Style/HashSyntax:
12
+ Enabled: false
13
+
14
+ Metrics/AbcSize:
15
+ Max: 25
16
+ Metrics/LineLength:
17
+ Max: 120
data/README.md CHANGED
@@ -6,7 +6,6 @@
6
6
  [![Coveralls branch](https://img.shields.io/coveralls/844196/n_cipher/master.svg)](https://coveralls.io/github/844196/n_cipher)
7
7
  [![Code Climate](https://img.shields.io/codeclimate/github/844196/n_cipher.svg)](https://codeclimate.com/github/844196/n_cipher)
8
8
  [![Issues](http://img.shields.io/github/issues/844196/n_cipher.svg)](https://github.com/844196/n_cipher/issues)
9
- [![Documents](http://img.shields.io/badge/doc-そんな物はない-red.svg?style=social)](#)
10
9
 
11
10
  ![](https://cloud.githubusercontent.com/assets/4990822/10408480/9bf5d63a-6f39-11e5-9568-55e24afcbdc5.png)
12
11
 
@@ -34,6 +33,8 @@ $ gem install n_cipher
34
33
 
35
34
  ## Usage
36
35
 
36
+ ### Library
37
+
37
38
  ```ruby
38
39
  require 'n_cipher'
39
40
 
@@ -46,6 +47,8 @@ NCipher::decode(
46
47
  #=> "にゃんぱす"
47
48
  ```
48
49
 
50
+ ### Command
51
+
49
52
  ```shellsession
50
53
  $ n_cipher --help
51
54
  Commands:
data/Rakefile CHANGED
@@ -1,7 +1,10 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'rubocop/rake_task'
2
3
 
3
4
  task :default => :test
4
5
 
5
6
  task :test do
6
7
  ruby("test/test_helper.rb")
7
8
  end
9
+
10
+ RuboCop::RakeTask.new
@@ -1,3 +1,3 @@
1
1
  module NCipher
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
data/lib/n_cipher.rb CHANGED
@@ -3,7 +3,7 @@ require "n_cipher/version"
3
3
  module NCipher
4
4
  module Helper
5
5
  def convert_table(string, mode)
6
- table = string.chars.map.with_index(0) {|c,i| [i.to_s, c] }.to_h
6
+ table = [*'0'..'9', *'a'..'z'].zip(string.chars).reject(&:one?).to_h
7
7
  case mode
8
8
  when :encode then table
9
9
  when :decode then table.invert
@@ -15,7 +15,7 @@ module NCipher
15
15
  raise TypeError, "#{obj} is #{obj.class} object. Argument must be string object." unless obj.kind_of?(String)
16
16
  raise ArgumentError, 'Invalid argument.' if obj.empty?
17
17
  end
18
- raise ArgumentError, 'Seed must be 2 to 10 characters.' unless seed.size.between?(2, 10)
18
+ raise ArgumentError, 'Seed must be 2 to 36 characters.' unless seed.size.between?(2, 36)
19
19
  raise ArgumentError, 'Seed and delimiter are duplicated.' unless (seed.chars & delimiter.chars).size.zero?
20
20
  # シード値が重複していないか?
21
21
  # OK: 'あいう'
data/n_cipher.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
 
12
12
  spec.summary = %q{ぱすすにすに〜ぱすすゃぱす〜ぱすすんんに〜ぱすすゃにゃ〜ぱすすににん〜ぱすぱんぱゃ}
13
13
  spec.description = %q{文字列のUnicodeエスケープシーケンスを利用した簡易的な暗号です}
14
- spec.homepage = "https://github.com/844196"
14
+ spec.homepage = "https://github.com/844196/n_cipher"
15
15
  spec.license = "MIT"
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "rake", "~> 10.0"
25
25
  spec.add_development_dependency "test-unit"
26
26
  spec.add_development_dependency "coveralls"
27
+ spec.add_development_dependency "rubocop"
27
28
 
28
29
  spec.add_dependency "thor"
29
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: n_cipher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaya Takeda
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-12 00:00:00.000000000 Z
11
+ date: 2015-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: thor
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -80,7 +94,7 @@ dependencies:
80
94
  - - ">="
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
83
- description: "文字列のUnicodeエスケープシーケンスを利用した簡易的な暗号です"
97
+ description: 文字列のUnicodeエスケープシーケンスを利用した簡易的な暗号です
84
98
  email:
85
99
  - 844196@gmail.com
86
100
  executables:
@@ -90,6 +104,7 @@ extra_rdoc_files: []
90
104
  files:
91
105
  - ".codeclimate.yml"
92
106
  - ".gitignore"
107
+ - ".rubocop.yml"
93
108
  - ".travis.yml"
94
109
  - Gemfile
95
110
  - LICENSE.txt
@@ -101,7 +116,7 @@ files:
101
116
  - lib/n_cipher.rb
102
117
  - lib/n_cipher/version.rb
103
118
  - n_cipher.gemspec
104
- homepage: https://github.com/844196
119
+ homepage: https://github.com/844196/n_cipher
105
120
  licenses:
106
121
  - MIT
107
122
  metadata: {}
@@ -124,5 +139,5 @@ rubyforge_project:
124
139
  rubygems_version: 2.4.5.1
125
140
  signing_key:
126
141
  specification_version: 4
127
- summary: "ぱすすにすに〜ぱすすゃぱす〜ぱすすんんに〜ぱすすゃにゃ〜ぱすすににん〜ぱすぱんぱゃ"
142
+ summary: ぱすすにすに〜ぱすすゃぱす〜ぱすすんんに〜ぱすすゃにゃ〜ぱすすににん〜ぱすぱんぱゃ
128
143
  test_files: []