iching 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/iching.gemspec +2 -1
  3. data/lib/iching.rb +8 -15
  4. data/readme.markdown +1 -6
  5. metadata +10 -12
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 567e0c98f1b44a86ebdc288e809e6172e639a0d4c5eab59cd439fd30ce9a607a
4
+ data.tar.gz: 39f7e2a9e4dbeaf798b1edd9efb8147f825d5295626c32eb0726f9262adef374
5
+ SHA512:
6
+ metadata.gz: 8bac72fe8e70ebfd6ebb418e6eb117426c2d244735f8922e4db54b342030956895fe49670020e86172421d8fa1476732a1b239a282cdf51ca299cf3e6cd29bbc
7
+ data.tar.gz: 745bf6b04d09f04a92a856c08857b755bc48a3115366c91b6e1fc527c2e89515b547afa2986a7f5dd00ba23aef316f85dfad1d335681d9a7b4aa9eb7849a7fd3
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |s|
3
3
  s.name = "iching"
4
- s.version = "0.1.3"
4
+ s.version = "0.2.0"
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = ["Matt Mills"]
7
7
  s.email = ["sunrisetimes@gmail.com"]
@@ -11,4 +11,5 @@ Gem::Specification.new do |s|
11
11
  s.files = `git ls-files`.split("\n")
12
12
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
13
13
  s.require_paths = ["lib"]
14
+ s.license = 'MIT'
14
15
  end
@@ -1,18 +1,12 @@
1
1
  # encoding: UTF-8
2
- require 'rubygems'
3
2
  require 'dictionaries.rb'
4
3
 
5
- #ruby version compatibility hax
6
- unless RUBY_VERSION.gsub(".","").to_i > 190
7
- require 'backports'
8
- end
9
-
10
-
11
4
  class Iching
12
- include Dictionaries
13
-
5
+ include ::Dictionaries
6
+
14
7
  def display
15
- if Random.new.rand(1..20) > 1
8
+ @current_hex = hex()
9
+ if Random.new.rand(1..20) > 1
16
10
  puts hex_symbol, hex_name, hex_symbol(2), hex_name(2)
17
11
  else
18
12
  puts "A suffusion of yellow."
@@ -21,9 +15,9 @@ class Iching
21
15
 
22
16
  def hex_name(second = false)
23
17
  unless second
24
- bin_hex = hex.inject('') {|store,stick| store << binhex1_key[stick]}
18
+ bin_hex = @current_hex.inject('') {|store,stick| store << binhex1_key[stick]}
25
19
  else
26
- bin_hex = hex.inject('') {|store,stick| store << binhex1_key[stick]}
20
+ bin_hex = @current_hex.inject('') {|store,stick| store << binhex1_key[stick]}
27
21
  end
28
22
  bin_hex.reverse!
29
23
  return list[bin_hex]
@@ -31,10 +25,9 @@ class Iching
31
25
 
32
26
  def hex_symbol(second = false)
33
27
  unless second
34
- hex.inject('') {|store, stick| store << hexagram1_key[stick] + "\n"}
28
+ @current_hex.inject('') {|store, stick| store << hexagram1_key[stick] + "\n"}
35
29
  else
36
- hex.inject('') {|store, stick| store << hexagram2_key[stick] + "\n"}
30
+ @current_hex.inject('') {|store, stick| store << hexagram2_key[stick] + "\n"}
37
31
  end
38
32
  end
39
-
40
33
  end
@@ -2,10 +2,5 @@
2
2
 
3
3
  This is a little program to cast I Ching hexagrams that I knocked together when I was first learning python, and have since improved at intervals when I was bored, and then I ported it to ruby, so you can use the class to get stuff about the hexagram, and use it in your awesome projects too. It depends on the backports gem for the random number generation, because I liked the way the new Random class from 1.9 works.
4
4
 
5
- ## Installation
6
-
7
- gem install backports
8
- gem install iching
9
-
10
5
  ## Usage
11
- There are class methods for accessing the symbol and the name of each hexagram, and also for displaying everything at once. It doesn't do much else right now. If you have any ideas, wants, or needs, let me know.
6
+ There are class methods for accessing the symbol and the name of each hexagram, and also for displaying everything at once. It doesn't do much else right now. If you have any ideas, wants, or needs, let me know.
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iching
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
5
- prerelease:
4
+ version: 0.2.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Matt Mills
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-10-04 00:00:00.000000000 Z
11
+ date: 2020-12-14 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: Generate an Iching hexagram and access various things about it.
15
14
  email:
@@ -19,7 +18,7 @@ executables:
19
18
  extensions: []
20
19
  extra_rdoc_files: []
21
20
  files:
22
- - .gitignore
21
+ - ".gitignore"
23
22
  - Rakefile
24
23
  - bin/iching
25
24
  - iching.gemspec
@@ -27,27 +26,26 @@ files:
27
26
  - lib/iching.rb
28
27
  - readme.markdown
29
28
  homepage: http://github.com/mattmills/iching
30
- licenses: []
29
+ licenses:
30
+ - MIT
31
+ metadata: {}
31
32
  post_install_message:
32
33
  rdoc_options: []
33
34
  require_paths:
34
35
  - lib
35
36
  required_ruby_version: !ruby/object:Gem::Requirement
36
- none: false
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  required_rubygems_version: !ruby/object:Gem::Requirement
42
- none: false
43
42
  requirements:
44
- - - ! '>='
43
+ - - ">="
45
44
  - !ruby/object:Gem::Version
46
45
  version: '0'
47
46
  requirements: []
48
- rubyforge_project:
49
- rubygems_version: 1.8.25
47
+ rubygems_version: 3.0.3
50
48
  signing_key:
51
- specification_version: 3
49
+ specification_version: 4
52
50
  summary: tell the future (but not really)
53
51
  test_files: []