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 +4 -4
- data/.gitignore +1 -0
- data/lib/bijint/version.rb +1 -1
- data/lib/bijint.rb +4 -5
- data/spec/bijint_spec.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bbced8240aed2fd31e4f6e50818f8f8cc21c76ab
|
|
4
|
+
data.tar.gz: daeab230cd6c5c8971a6be6848c310ac6782eccd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ac795a1762fd6153d36255d8053448c00055739d1638e0fd0ae38a0c787ba5ca71831dddd5dadf91725f3f649068e9a2af97f16eff765828d201c2ac6640130a
|
|
7
|
+
data.tar.gz: 47ca343f7e08b83ffee951f16a572a26a388dab407cbf683a41e97685d947455bdc697f510fd054510b1cbbd2ac341d742e06271cde6e2c80b56278050045f7c
|
data/.gitignore
CHANGED
data/lib/bijint/version.rb
CHANGED
data/lib/bijint.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require
|
|
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
|
-
|
|
19
|
-
"[})](#{url(set_area, _time_rand)})"
|
|
18
|
+
"[})](#{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
|
|
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
|
|
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\/
|
|
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
|
|
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\/
|
|
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
|
|