dickens 0.1.1 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,5 @@
1
+ ##v0.2.1
2
+ *fixed inclusion bug and added readme
1
3
  ##v0.1.1
2
4
  *Provided simple api for useing StarDict console version
3
5
 
data/README.md CHANGED
@@ -1,14 +1,65 @@
1
1
  #Dickens
2
2
 
3
+ `gem install dickens`
4
+
3
5
  ## SDCV installation
6
+ ### Linux
7
+
8
+ ```sh
9
+ sudo apt-get install sdcv
10
+ ```
11
+
12
+ ### MacOS
13
+ In Mac OS it is possible to install SDCV using Ports:
14
+
15
+ ```sh
16
+ port install sdcv
17
+ ```
18
+
19
+ ### Dictionaries
20
+ Lots of dics may be found across the net. The starting point may be (here)[http://www.stardict.org/download.php]
21
+ #### Install dictionaries on Linux
22
+
23
+ ```sh
24
+ tar -xjvf a.tar.bz2
25
+ mv a /usr/share/stardict/dic
26
+ ```
4
27
 
5
28
  ## API methods
6
29
  ### List
30
+ After everything is installed you can list the dictionaries:
31
+
32
+ ```ruby
33
+ Dickens::StarDict.list
34
+ ```
7
35
 
8
36
  ### Find
37
+ You can lookup desired definition through all dics at once:
38
+
39
+ ```ruby
40
+ Dickens::StarDict.find("Dickens")
41
+ ```
9
42
 
10
43
  ### Where
44
+ Define dictionaries to lookup only inside those dics:
45
+ ```ruby
46
+ list=Dickens::StarDict.list
47
+ Dickens::StarDict.where("Dickens", [list[1], list[3]])
48
+ ```
11
49
 
12
50
  ### Configuration
51
+ Change the path to executable:
52
+ ```ruby
53
+ Dickens::StarDict.executable = "./lib/my_sdcv"
54
+ ```
55
+
56
+ Control your options
57
+ ```ruby
58
+ Dickens::StarDict.config :use_dict => false,
59
+ :utf8_input => true,
60
+ :utf8_output => true,
61
+ :non_interactive => true,
62
+ :data_dir=>false
63
+ ```
13
64
 
14
65
 
@@ -1,7 +1,4 @@
1
1
  require "dickens/version"
2
- require "dickens/dickens"
3
- require "dickens/list_items"
4
- require "dickens/find_items"
5
2
 
6
3
  require 'rbconfig'
7
4
  require RbConfig::CONFIG['target_os'] == 'mingw32' && !(RUBY_VERSION =~ /1.9/) ? 'win32/open3' : 'open3'
@@ -14,6 +11,10 @@ rescue LoadError
14
11
  require 'active_support/core_ext/blank'
15
12
  end
16
13
 
14
+ require "dickens/dickens"
15
+ require "dickens/list_items"
16
+ require "dickens/find_items"
17
+
17
18
  class Object
18
19
  ##
19
20
  # @person ? @person.name : nil
@@ -11,6 +11,9 @@ module Dickens
11
11
  }
12
12
  cattr_accessor :config, :executable
13
13
 
14
+ def self.config(hash)
15
+ @@config.merge!(hash)
16
+ end
14
17
 
15
18
  ##Использование:
16
19
  # sdcv [ПАРАМЕТР...] words
@@ -1,3 +1,3 @@
1
1
  module Dickens
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dickens
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-10-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70205088649280 !ruby/object:Gem::Requirement
16
+ requirement: &70177767292200 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70205088649280
24
+ version_requirements: *70177767292200
25
25
  description: For now you can gather all your dictionaries together and search through
26
26
  them getting pretty rails-style records back
27
27
  email: