bijint 0.1.0 → 0.2.0

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: e50147878e329eb7f951dedb8536a1070d62fa97
4
- data.tar.gz: 6b1ea96a484aed737c737f1e7173b789f2021399
3
+ metadata.gz: bbced8240aed2fd31e4f6e50818f8f8cc21c76ab
4
+ data.tar.gz: daeab230cd6c5c8971a6be6848c310ac6782eccd
5
5
  SHA512:
6
- metadata.gz: e05a95954370e00194c11973890b2b2624d47034c249ecdfc5a1bff1a74f93c78ff7f503be57d353fda9c2965e7c817a1cc8b662e50b86256c9857bc778ad2c1
7
- data.tar.gz: 322d536eed97ed87eefbf7a888eabbbb7eabf13fd92e012ac1a4fbaf97ba39f5dff6aed03ba0199b8d930b708677ad89d59fd8055d22a5418b47a14fad07c91c
6
+ metadata.gz: ac795a1762fd6153d36255d8053448c00055739d1638e0fd0ae38a0c787ba5ca71831dddd5dadf91725f3f649068e9a2af97f16eff765828d201c2ac6640130a
7
+ data.tar.gz: 47ca343f7e08b83ffee951f16a572a26a388dab407cbf683a41e97685d947455bdc697f510fd054510b1cbbd2ac341d742e06271cde6e2c80b56278050045f7c
data/.gitignore CHANGED
@@ -14,3 +14,4 @@
14
14
  mkmf.log
15
15
  .DS_Store
16
16
  .idea
17
+ *.swp
@@ -1,3 +1,3 @@
1
1
  module Bijint
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/bijint.rb CHANGED
@@ -1,4 +1,4 @@
1
- require "bijint/version"
1
+ require 'bijint/version'
2
2
 
3
3
  module Bijint
4
4
  class Bijint
@@ -15,8 +15,7 @@ module Bijint
15
15
  end
16
16
 
17
17
  def md_random
18
- _time_rand = time_rand
19
- "[![bijint](#{url(set_area, _time_rand)})](#{url(set_area, _time_rand)})"
18
+ "[![bijint](#{url(set_area, time_rand)})](#{url(set_area, time_rand)})"
20
19
  end
21
20
 
22
21
  def url(area, time)
@@ -24,10 +23,10 @@ module Bijint
24
23
  end
25
24
 
26
25
  def set_area
27
- %w(tokyo).shuffle.first
26
+ %w(kyoto shizuoka saga kobe tochigi miyazaki kagoshima hiroshima kanazawa nara hokkaido nagasaki okayama gunma sendai kanagawa fukui nagoya tottori osaka akita okinawa nagano saitama tokyo ibaraki iwate niigata kagawa fukuoka kumamoto yamaguchi aomori chiba yamanashi hanayome 2012jp tv-asahi sara 2013jp cc wasedastyle megane hairstyle 2011jp bimajo thailand hawaii taiwan jakarta).shuffle.first
28
27
  end
29
28
 
30
- def time_rand from = 0.0, to = Time.now
29
+ def time_rand(from = 0.0, to = Time.now)
31
30
  Time.at(from + rand * (to.to_f - from.to_f))
32
31
  end
33
32
  end
data/spec/bijint_spec.rb CHANGED
@@ -7,20 +7,20 @@ describe Bijint do
7
7
 
8
8
  it 'now' do
9
9
  time = Time.now
10
- expect(bijint.now).to eq "http://www.bijint.com/assets/pict/tokyo/pc/#{time.strftime('%H%M')}.jpg"
10
+ expect(bijint.now).to match /http:\/\/www\.bijint\.com\/assets\/pict\/[a-z0-9]+\/pc\/#{time.strftime('%H%M')}\.jpg/
11
11
  end
12
12
 
13
13
  it 'random' do
14
- expect(bijint.random).to match /http:\/\/www\.bijint\.com\/assets\/pict\/tokyo\/pc\/\d{4}\.jpg/
14
+ expect(bijint.random).to match /http:\/\/www\.bijint\.com\/assets\/pict\/[a-z0-9]+\/pc\/\d{4}\.jpg/
15
15
  end
16
16
 
17
17
  it 'md' do
18
18
  time = Time.now
19
- expect(bijint.md).to eq "[![bijint](http://www.bijint.com/assets/pict/tokyo/pc/#{time.strftime('%H%M')}.jpg)](http://www.bijint.com/assets/pict/tokyo/pc/#{time.strftime('%H%M')}.jpg)"
19
+ expect(bijint.md).to match /\[!\[bijint\]\(http:\/\/www\.bijint\.com\/assets\/pict\/[a-z0-9]+\/pc\/#{time.strftime('%H%M')}\.jpg\)\]\(http:\/\/www\.bijint\.com\/assets\/pict\/[a-z0-9]+\/pc\/#{time.strftime('%H%M')}\.jpg\)/
20
20
  end
21
21
 
22
22
  it 'md_random' do
23
- expect(bijint.md_random).to match /\[!\[bijint\]\(http:\/\/www\.bijint\.com\/assets\/pict\/tokyo\/pc\/\d{4}\.jpg\)\]\(http:\/\/www\.bijint\.com\/assets\/pict\/tokyo\/pc\/\d{4}\.jpg\)/
23
+ expect(bijint.md_random).to match /\[!\[bijint\]\(http:\/\/www\.bijint\.com\/assets\/pict\/[a-z0-9]+\/pc\/\d{4}\.jpg\)\]\(http:\/\/www\.bijint\.com\/assets\/pict\/[a-z0-9]+\/pc\/\d{4}\.jpg\)/
24
24
  end
25
25
  end
26
26
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bijint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - funnythingz