bijint 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2f0ca4a12d332ce0c382e5c2e59eb011177d03a7
4
+ data.tar.gz: 2eafbcd6b05613fcb8f575778584f2b01072dc33
5
+ SHA512:
6
+ metadata.gz: f431c266e8829328a2ddf77cc60482cc1a3d7f1c4f362647b825bc882c816629e31a45d09d8360e75b6a9c323ef44f4c3dae9e611cca1fea945d83d43b89bc08
7
+ data.tar.gz: d4afdc3c838b01ea5f05c88dde6d25f0902916501827c23de9d060b5a2b840d98e04e936b3da3183e9b2fcaa17d276fb740a7c102942bfef5e4c8ae48836d6e7
data/.gitignore ADDED
@@ -0,0 +1,16 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+ .DS_Store
16
+ .idea
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.5
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in bijint.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 funnythingz
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,57 @@
1
+ # Bijint
2
+
3
+ You fall in love for one minute.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'bijint'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install bijint
20
+
21
+ ## Usage
22
+
23
+ ### now
24
+
25
+ ```sh
26
+ % bijint
27
+ "http://www.bijint.com/assets/pict/tokyo/pc/2357.jpg"
28
+ ```
29
+
30
+ ### random
31
+
32
+ ```sh
33
+ % bijint random
34
+ "http://www.bijint.com/assets/pict/tokyo/pc/0003.jpg"
35
+ ```
36
+
37
+ ### lgtm
38
+
39
+ ```sh
40
+ % bijint lgtm
41
+ "[![bijint](http://www.bijint.com/assets/pict/tokyo/pc/2357.jpg)](http://www.bijint.com/assets/pict/tokyo/pc/2357.jpg)"
42
+ ```
43
+
44
+ ### lgtm random
45
+
46
+ ```sh
47
+ % bijint lgtm_random
48
+ "[![bijint](http://www.bijint.com/assets/pict/tokyo/pc/0025.jpg)](http://www.bijint.com/assets/pict/tokyo/pc/0025.jpg)"
49
+ ```
50
+
51
+ ## Contributing
52
+
53
+ 1. Fork it ( https://github.com/funnythingz/bijint/fork )
54
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
55
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
56
+ 4. Push to the branch (`git push origin my-new-feature`)
57
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
7
+
data/bijint.gemspec ADDED
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'bijint/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "bijint"
8
+ spec.version = Bijint::VERSION
9
+ spec.authors = ["funnythingz"]
10
+ spec.email = ["funnythingz69+github@gmail.com"]
11
+ spec.summary = %q{bijint is BIJIN TOKEI}
12
+ spec.description = %q{You fall in love for one minute.}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.7"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "rspec"
24
+ end
data/bin/bijint ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bijint'
4
+
5
+ bijint = Bijint::Bijint.new
6
+
7
+ if ARGV.empty?
8
+ p bijint.now
9
+ else
10
+ p bijint.random if ARGV.first == 'random'
11
+ p bijint.lgtm if ARGV.first == 'lgtm'
12
+ p bijint.lgtm_random if ARGV.first == 'lgtm_random'
13
+ end
@@ -0,0 +1,3 @@
1
+ module Bijint
2
+ VERSION = "0.0.1"
3
+ end
data/lib/bijint.rb ADDED
@@ -0,0 +1,34 @@
1
+ require "bijint/version"
2
+
3
+ module Bijint
4
+ class Bijint
5
+ def now
6
+ url(set_area, Time.now)
7
+ end
8
+
9
+ def random
10
+ url(set_area, time_rand)
11
+ end
12
+
13
+ def lgtm
14
+ "[![bijint](#{url(set_area, Time.now)})](#{url(set_area, Time.now)})"
15
+ end
16
+
17
+ def lgtm_random
18
+ _time_rand = time_rand
19
+ "[![bijint](#{url(set_area, _time_rand)})](#{url(set_area, _time_rand)})"
20
+ end
21
+
22
+ def url(area, time)
23
+ "http://www.bijint.com/assets/pict/#{area}/pc/#{time.strftime('%H%M')}.jpg"
24
+ end
25
+
26
+ def set_area
27
+ %w(tokyo).shuffle.first
28
+ end
29
+
30
+ def time_rand from = 0.0, to = Time.now
31
+ Time.at(from + rand * (to.to_f - from.to_f))
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+
3
+ describe Bijint do
4
+
5
+ describe 'now' do
6
+ let(:bijint) {
7
+ Bijint::Bijint.new
8
+ }
9
+
10
+ it {
11
+ time = Time.now
12
+ expect(bijint.now).to eq "http://www.bijint.com/assets/pict/tokyo/pc/#{time.strftime('%H%M')}.jpg"
13
+ }
14
+ end
15
+
16
+ describe 'lgtm' do
17
+ let(:bijint) {
18
+ Bijint::Bijint.new
19
+ }
20
+
21
+ it {
22
+ time = Time.now
23
+ expect(bijint.lgtm).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)"
24
+ }
25
+ end
26
+
27
+ end
@@ -0,0 +1,2 @@
1
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
+ require 'bijint'
metadata ADDED
@@ -0,0 +1,103 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bijint
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - funnythingz
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: You fall in love for one minute.
56
+ email:
57
+ - funnythingz69+github@gmail.com
58
+ executables:
59
+ - bijint
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - ".rspec"
65
+ - ".travis.yml"
66
+ - Gemfile
67
+ - LICENSE.txt
68
+ - README.md
69
+ - Rakefile
70
+ - bijint.gemspec
71
+ - bin/bijint
72
+ - lib/bijint.rb
73
+ - lib/bijint/version.rb
74
+ - spec/bijint_spec.rb
75
+ - spec/spec_helper.rb
76
+ homepage: ''
77
+ licenses:
78
+ - MIT
79
+ metadata: {}
80
+ post_install_message:
81
+ rdoc_options: []
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ requirements: []
95
+ rubyforge_project:
96
+ rubygems_version: 2.2.2
97
+ signing_key:
98
+ specification_version: 4
99
+ summary: bijint is BIJIN TOKEI
100
+ test_files:
101
+ - spec/bijint_spec.rb
102
+ - spec/spec_helper.rb
103
+ has_rdoc: