skk-jisyo 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.rspec +2 -0
- data/.travis.yml +3 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +674 -0
- data/README.md +33 -0
- data/Rakefile +16 -0
- data/bin/skk-jisyo-manage +36 -0
- data/jisyo/SKK-JISYO.L +175820 -0
- data/jisyo/SKK-JISYO.L.timestamp +1 -0
- data/jisyo/SKK-JISYO.jinmei +19989 -0
- data/jisyo/SKK-JISYO.jinmei.timestamp +1 -0
- data/jisyo/SKK-JISYO.propernoun +9297 -0
- data/jisyo/SKK-JISYO.propernoun.timestamp +1 -0
- data/jisyo/SKK-JISYO.station +20905 -0
- data/jisyo/SKK-JISYO.station.timestamp +1 -0
- data/jisyo/skk-jisyo.yml +2 -0
- data/lib/skk/jisyo.rb +57 -0
- data/lib/skk/jisyo/version.rb +5 -0
- data/skk-jisyo.gemspec +26 -0
- data/spec/skk/jisyo_spec.rb +21 -0
- data/spec/spec_helper.rb +2 -0
- metadata +126 -0
@@ -0,0 +1 @@
|
|
1
|
+
2006-01-04 19:25:14 +0900
|
data/jisyo/skk-jisyo.yml
ADDED
data/lib/skk/jisyo.rb
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
require "skk/jisyo/version"
|
2
|
+
require "open-uri"
|
3
|
+
require "settingslogic"
|
4
|
+
|
5
|
+
module Skk
|
6
|
+
module Jisyo
|
7
|
+
JISYO_DIR = File.expand_path("../../../jisyo", __FILE__)
|
8
|
+
|
9
|
+
class Settings < ::Settingslogic
|
10
|
+
source "#{JISYO_DIR}/skk-jisyo.yml"
|
11
|
+
end
|
12
|
+
|
13
|
+
JISYO_URL = Settings.jisyo_url
|
14
|
+
|
15
|
+
def self.url(suffix = "L")
|
16
|
+
"#{JISYO_URL}/SKK-JISYO.#{suffix}"
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.urls
|
20
|
+
Settings.jisyo_list.map{|suffix| url(suffix) }
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.path(suffix = "L")
|
24
|
+
"#{JISYO_DIR}/SKK-JISYO.#{suffix}"
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.paths
|
28
|
+
Settings.jisyo_list.map{|suffix| path(suffix) }
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.update(suffix = "L")
|
32
|
+
local_path = path(suffix)
|
33
|
+
local_timestamp_path = "#{local_path}.timestamp"
|
34
|
+
local_timestamp = File.read(local_timestamp_path) if File.exists?(local_timestamp_path)
|
35
|
+
|
36
|
+
open(url(suffix)) do |remote_file|
|
37
|
+
remote_timestamp = remote_file.last_modified.to_s
|
38
|
+
if local_timestamp != remote_timestamp
|
39
|
+
jisyo_data = remote_file.read
|
40
|
+
File.open(local_path, "wb") do |local_file|
|
41
|
+
local_file.write(jisyo_data)
|
42
|
+
end
|
43
|
+
File.write(local_timestamp_path, remote_timestamp)
|
44
|
+
puts "#{path(suffix)}: #{jisyo_data.length} bytes (#{remote_timestamp})"
|
45
|
+
else
|
46
|
+
puts "#{path(suffix)} is not modified (#{remote_timestamp})"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.update_all
|
52
|
+
Settings.jisyo_list.each do |suffix|
|
53
|
+
update(suffix)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
data/skk-jisyo.gemspec
ADDED
@@ -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 'skk/jisyo/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "skk-jisyo"
|
8
|
+
spec.version = Skk::Jisyo::VERSION
|
9
|
+
spec.authors = ["hogelog"]
|
10
|
+
spec.email = ["konbu.komuro@gmail.com"]
|
11
|
+
spec.description = %q{Install SKK-JISYO files}
|
12
|
+
spec.summary = %q{Install SKK-JISYO}
|
13
|
+
spec.homepage = "https://github.com/hogelog/skk-jisyo"
|
14
|
+
spec.license = "GPL3"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency "settingslogic"
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
24
|
+
spec.add_development_dependency "rake"
|
25
|
+
spec.add_development_dependency "rspec"
|
26
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Skk::Jisyo do
|
4
|
+
it 'should have a version number' do
|
5
|
+
Skk::Jisyo::VERSION.should_not be_nil
|
6
|
+
end
|
7
|
+
|
8
|
+
describe ".path" do
|
9
|
+
context "with no params" do
|
10
|
+
it "returns SKK-JISYO path" do
|
11
|
+
expect(Skk::Jisyo.path).to end_with("SKK-JISYO.L")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
context "with suffix params" do
|
16
|
+
it "returns SKK-JISYO.suffix path" do
|
17
|
+
expect(Skk::Jisyo.path("jinmei")).to end_with("SKK-JISYO.jinmei")
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: skk-jisyo
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- hogelog
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-10-16 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: settingslogic
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
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: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: Install SKK-JISYO files
|
70
|
+
email:
|
71
|
+
- konbu.komuro@gmail.com
|
72
|
+
executables:
|
73
|
+
- skk-jisyo-manage
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- .gitignore
|
78
|
+
- .rspec
|
79
|
+
- .travis.yml
|
80
|
+
- Gemfile
|
81
|
+
- LICENSE.txt
|
82
|
+
- README.md
|
83
|
+
- Rakefile
|
84
|
+
- bin/skk-jisyo-manage
|
85
|
+
- jisyo/SKK-JISYO.L
|
86
|
+
- jisyo/SKK-JISYO.L.timestamp
|
87
|
+
- jisyo/SKK-JISYO.jinmei
|
88
|
+
- jisyo/SKK-JISYO.jinmei.timestamp
|
89
|
+
- jisyo/SKK-JISYO.propernoun
|
90
|
+
- jisyo/SKK-JISYO.propernoun.timestamp
|
91
|
+
- jisyo/SKK-JISYO.station
|
92
|
+
- jisyo/SKK-JISYO.station.timestamp
|
93
|
+
- jisyo/skk-jisyo.yml
|
94
|
+
- lib/skk/jisyo.rb
|
95
|
+
- lib/skk/jisyo/version.rb
|
96
|
+
- skk-jisyo.gemspec
|
97
|
+
- spec/skk/jisyo_spec.rb
|
98
|
+
- spec/spec_helper.rb
|
99
|
+
homepage: https://github.com/hogelog/skk-jisyo
|
100
|
+
licenses:
|
101
|
+
- GPL3
|
102
|
+
metadata: {}
|
103
|
+
post_install_message:
|
104
|
+
rdoc_options: []
|
105
|
+
require_paths:
|
106
|
+
- lib
|
107
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - '>='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - '>='
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
requirements: []
|
118
|
+
rubyforge_project:
|
119
|
+
rubygems_version: 2.0.3
|
120
|
+
signing_key:
|
121
|
+
specification_version: 4
|
122
|
+
summary: Install SKK-JISYO
|
123
|
+
test_files:
|
124
|
+
- spec/skk/jisyo_spec.rb
|
125
|
+
- spec/spec_helper.rb
|
126
|
+
has_rdoc:
|