alc-cmd 0.0.4 → 0.0.5

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.
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format documentation
data/Gemfile CHANGED
@@ -2,4 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in alc-cmd.gemspec
4
4
  gemspec
5
- gem 'mechanize'
@@ -7,7 +7,7 @@ Gem::Specification.new do |gem|
7
7
  gem.name = "alc-cmd"
8
8
  gem.version = Alc::Cmd::VERSION
9
9
  gem.authors = ["Kazuhiro Yamada"]
10
- gem.email = ["kyamada@sonix.asia"]
10
+ gem.email = ["yamadakazu45@gmail.com"]
11
11
  gem.description = %q{Command-line tool to translate English to Japanese }
12
12
  gem.summary = %q{Use SPACE ALC (http://eow.alc.co.jp/) from command line.}
13
13
  gem.homepage = "https://github.com/k-yamada/alc-cmd"
@@ -19,4 +19,5 @@ Gem::Specification.new do |gem|
19
19
 
20
20
  gem.add_dependency 'thor'
21
21
  gem.add_dependency 'mechanize'
22
+ gem.add_development_dependency 'rspec'
22
23
  end
@@ -5,9 +5,3 @@ require 'thor'
5
5
 
6
6
  result_text = Alc::Cmd::CLI.start
7
7
 
8
- tmp_file_name = "/tmp/alc.temp" + Time.now.to_f.ceil.to_s
9
- File.open("#{tmp_file_name}", "w") do |file|
10
- file.write(result_text)
11
- end
12
- system("less -R #{tmp_file_name}")
13
- system("rm -rf #{tmp_file_name}")
@@ -8,7 +8,17 @@ module Alc; module Cmd
8
8
 
9
9
  desc "s [WORD1 WORD2]", "serach words"
10
10
  def s(*words)
11
- Eijiro.new.search(words)
11
+ result = Eijiro.new.search(words)
12
+ show_console(result)
13
+ end
14
+
15
+ private
16
+
17
+ def show_console(text)
18
+ tmp_file_name = "/tmp/alc.temp" + Time.now.to_f.ceil.to_s
19
+ File.open(tmp_file_name, "w") do |file| file.write(text) end
20
+ system("less -R #{tmp_file_name}")
21
+ system("rm -rf #{tmp_file_name}")
12
22
  end
13
23
 
14
24
  end
@@ -1,5 +1,5 @@
1
1
  module Alc
2
2
  module Cmd
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
@@ -0,0 +1,10 @@
1
+ require 'spec_helper'
2
+
3
+ module Alc; module Cmd
4
+ describe Eijiro do
5
+ it "make query from words" do
6
+ query = Eijiro.new().make_query_from_words(["test", "what"])
7
+ query.should == "test+what"
8
+ end
9
+ end
10
+ end; end
@@ -0,0 +1,8 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ require 'alc-cmd' # and any other gems you need
5
+
6
+ RSpec.configure do |config|
7
+ # some (optional) config here
8
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alc-cmd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-07 00:00:00.000000000 Z
12
+ date: 2012-12-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -43,15 +43,32 @@ dependencies:
43
43
  - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rspec
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
46
62
  description: ! 'Command-line tool to translate English to Japanese '
47
63
  email:
48
- - kyamada@sonix.asia
64
+ - yamadakazu45@gmail.com
49
65
  executables:
50
66
  - alc-cmd
51
67
  extensions: []
52
68
  extra_rdoc_files: []
53
69
  files:
54
70
  - .gitignore
71
+ - .rspec
55
72
  - Gemfile
56
73
  - LICENSE.txt
57
74
  - README.md
@@ -62,6 +79,8 @@ files:
62
79
  - lib/alc-cmd/cli.rb
63
80
  - lib/alc-cmd/eijiro.rb
64
81
  - lib/alc-cmd/version.rb
82
+ - spec/alc-cmd/eijiro_spec.rb
83
+ - spec/spec_helper.rb
65
84
  homepage: https://github.com/k-yamada/alc-cmd
66
85
  licenses: []
67
86
  post_install_message:
@@ -82,9 +101,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
101
  version: '0'
83
102
  requirements: []
84
103
  rubyforge_project:
85
- rubygems_version: 1.8.24
104
+ rubygems_version: 1.8.23
86
105
  signing_key:
87
106
  specification_version: 3
88
107
  summary: Use SPACE ALC (http://eow.alc.co.jp/) from command line.
89
- test_files: []
90
- has_rdoc:
108
+ test_files:
109
+ - spec/alc-cmd/eijiro_spec.rb
110
+ - spec/spec_helper.rb