pebbles-voyage_conference_room 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b0f41640cdd4050ff64848afdc4c3a203b5216e5
4
+ data.tar.gz: daa017d96a372fec74c2c9dfa80488f64649c8eb
5
+ SHA512:
6
+ metadata.gz: a2449b2087a2fb77fc4eb9818edcfd3d564ce3fb3785c6ec3f6c1ae12b39c862a182c268f5375565cd5a8e7d709c41e5de42b3eb09ae63b3925a4eb442aca054
7
+ data.tar.gz: 8365c4fc53a9088d07b5beaaaeee3ceff915a375f96770f5765984f0ec1ebef5532fbeb5292d16c713bc0b10e97e90a7dea53dbda7ba4e686c477d4abd616364
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in pebbles-voyage_conference_room.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 fukayatsu
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.
@@ -0,0 +1,45 @@
1
+ # Pebbles::VoyageConferenceRoom
2
+
3
+ Floor map of VoyageGroup 8F
4
+
5
+ Ruby port of [Acme::VOYAGEGROUP::ConferenceRoom - search.cpan.org](http://search.cpan.org/~monmon/Acme-VOYAGEGROUP-ConferenceRoom-0.01/lib/Acme/VOYAGEGROUP/ConferenceRoom.pm)
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ gem 'pebbles-voyage_conference_room'
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install pebbles-voyage_conference_room
20
+
21
+ ## Usage
22
+
23
+ ```
24
+ $ voyage_conference_room list
25
+ pangea
26
+ ultima
27
+ ...
28
+
29
+ $ voyage_conference_room map
30
+ $ voyage_conference_room map --with-code
31
+ $ voyage_conference_room map --name=pangea
32
+ $ voyage_conference_room map --name=パンゲア
33
+ $ voyage_conference_room map --name=AJITO
34
+ $ voyage_conference_room map --code=a
35
+
36
+ ```
37
+
38
+
39
+ ## Contributing
40
+
41
+ 1. Fork it ( http://github.com/fukayatsu/pebbles-voyage_conference_room/fork )
42
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
43
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
44
+ 4. Push to the branch (`git push origin my-new-feature`)
45
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pebbles/voyage_conference_room/cli'
3
+ Pebbles::VoyageConferenceRoom::CLI.start
@@ -0,0 +1,110 @@
1
+
2
+ floor_map: |
3
+ .---------------.--.------------------.
4
+ |aaaaaaaaaaaaaaa| |ppp| |qq| |rrr|
5
+ |aaaaaaaaaaaaaaa| '---.--.--.----.---|
6
+ |aaaaaaaaaaaaaaa| |dd|ee|ffff|ggg|
7
+ |aaaaaaaaaaaaaaa|---. |dd|--|ffff|ggg|
8
+ |aaaaaaaaaaaaaaa|bbb| '--' '----|ggg|
9
+ |aaaaaaaaaaaaaaa|---'-. .'---|
10
+ |aaaaaaaaaaaaaaa|ccccc| |hhhh|
11
+ '---------------'-----'.--.--. .'----|
12
+ |iiiii| |jjjjj|
13
+ |--.--| |--.--|
14
+ |kk|ll| |mm|nn|
15
+ '--'--' '--'--|
16
+ |
17
+ .------------|
18
+ |oooooooooooo|
19
+ |oooooooooooo|
20
+ '------------'
21
+
22
+ rooms:
23
+ pangea:
24
+ code: a
25
+ aliases:
26
+ - パンゲア
27
+ - ぱんげあ
28
+ ultima:
29
+ code: b
30
+ aliases:
31
+ - ウルティマ
32
+ - うるてぃま
33
+ zipang:
34
+ code: c
35
+ aliases:
36
+ - パシフィス
37
+ - じぱんぐ
38
+ megallanica:
39
+ code: d
40
+ aliases:
41
+ - メガラニカ
42
+ - めがらにか
43
+ mu:
44
+ code: e
45
+ aliases:
46
+ - ムー
47
+ - むー
48
+ atlantis:
49
+ code: f
50
+ aliases:
51
+ - アトランティス
52
+ - あとらんてぃす
53
+ pacifis:
54
+ code: g
55
+ aliases:
56
+ - パシフィス
57
+ - ぱしふぃす
58
+ lemuria:
59
+ code: h
60
+ aliases:
61
+ - レムリア
62
+ - れむりあ
63
+ africa:
64
+ code: i
65
+ aliases:
66
+ - アフリカ
67
+ - あふりか
68
+ eurasia:
69
+ code: j
70
+ aliases:
71
+ - ユーラシア
72
+ - ゆーらしあ
73
+ antarctica:
74
+ code: k
75
+ aliases:
76
+ - アンタークティカ
77
+ - あんたーくてぃか
78
+ australlia:
79
+ code: l
80
+ aliases:
81
+ - オーストラリア
82
+ - おーすとらりあ
83
+ south_america:
84
+ code: m
85
+ aliases:
86
+ - サウスアメリカ
87
+ - さうすあめりか
88
+ north_america:
89
+ code: n
90
+ aliases:
91
+ - ノースアメリカ
92
+ - のーすあめりか
93
+ ajito:
94
+ code: o
95
+ aliases:
96
+ - アジト
97
+ - あじと
98
+ wc_men:
99
+ code: p
100
+ aliases:
101
+ - 男子トイレ
102
+ amasia:
103
+ code: q
104
+ aliases:
105
+ - アメイジア
106
+ - あめいじあ
107
+ wc_women:
108
+ code: r
109
+ aliases:
110
+ - 女子トイレ
@@ -0,0 +1,8 @@
1
+ require "pebbles/voyage_conference_room/version"
2
+ require "pebbles/voyage_conference_room/floor"
3
+
4
+ module Pebbles
5
+ module VoyageConferenceRoom
6
+ # Your code goes here...
7
+ end
8
+ end
@@ -0,0 +1,27 @@
1
+ require "thor"
2
+ require "rainbow/ext/string"
3
+ require "pebbles/voyage_conference_room"
4
+
5
+ module Pebbles
6
+ module VoyageConferenceRoom
7
+ class CLI < Thor
8
+ desc "list", "list rooms"
9
+ def list
10
+ puts floor.rooms.keys.join("\n")
11
+ end
12
+
13
+ desc "map", "show floor map"
14
+ method_option :with_code, :aliases => "-w", :desc => "show map with code", type: :boolean, default: false
15
+ method_option :name, :aliases => "-n", :desc => "find room by name"
16
+ method_option :code, :aliases => "-c", :desc => "find room by code"
17
+ def map
18
+ puts floor.show_map(options)
19
+ end
20
+
21
+ private
22
+ def floor
23
+ @floor ||= Floor.new
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,34 @@
1
+ require 'yaml'
2
+
3
+ module Pebbles
4
+ module VoyageConferenceRoom
5
+ class Floor
6
+ def initialize
7
+ gem_spec = Gem::Specification.find_by_name("pebbles-voyage_conference_room")
8
+ rooms_spec = YAML.load_file("#{gem_spec.gem_dir}/config/rooms.yml")
9
+ @floor_map = rooms_spec["floor_map"]
10
+ @rooms = rooms_spec["rooms"]
11
+ end
12
+ attr_reader :floor_map, :rooms
13
+
14
+ def show_map(options)
15
+ name = options["name"].to_s.downcase
16
+ code = options["code"]
17
+
18
+ selected_rooms = rooms.select! do |k, v|
19
+ k == name || v["aliases"].include?(name) || v["code"] == code
20
+ end
21
+
22
+ map = floor_map
23
+ if options["with_code"]
24
+ selected_rooms.map{ |k,v| v["code"] }.each{ |code| map.gsub!(code, "/".color(:red)) }
25
+ else
26
+ selected_rooms.map{ |k,v| v["code"] }.each{ |code| map.gsub!(code, '/') }
27
+ map.gsub!(/[a-z]/, ' ')
28
+ map.gsub!("/", "/".color(:red))
29
+ end
30
+ map
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,5 @@
1
+ module Pebbles
2
+ module VoyageConferenceRoom
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'pebbles/voyage_conference_room/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "pebbles-voyage_conference_room"
8
+ spec.version = Pebbles::VoyageConferenceRoom::VERSION
9
+ spec.authors = ["fukayatsu"]
10
+ spec.email = ["fukayatsu@gmail.com"]
11
+ spec.summary = %q{Floor map of VoyageGroup 8F}
12
+ spec.description = %q{Floor map of VoyageGroup 8F}
13
+ spec.homepage = "https://github.com/fukayatsu/pebbles-voyage_conference_room"
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 "thor"
22
+ spec.add_development_dependency "rainbow"
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.5"
25
+ spec.add_development_dependency "rake"
26
+ spec.add_development_dependency "pry"
27
+ spec.add_development_dependency "rspec", "~> 3.0.0.beta2"
28
+ end
metadata ADDED
@@ -0,0 +1,141 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pebbles-voyage_conference_room
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - fukayatsu
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-03-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rainbow
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.5'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pry
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 3.0.0.beta2
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 3.0.0.beta2
97
+ description: Floor map of VoyageGroup 8F
98
+ email:
99
+ - fukayatsu@gmail.com
100
+ executables:
101
+ - voyage_conference_room
102
+ extensions: []
103
+ extra_rdoc_files: []
104
+ files:
105
+ - ".gitignore"
106
+ - Gemfile
107
+ - LICENSE.txt
108
+ - README.md
109
+ - Rakefile
110
+ - bin/voyage_conference_room
111
+ - config/rooms.yml
112
+ - lib/pebbles/voyage_conference_room.rb
113
+ - lib/pebbles/voyage_conference_room/cli.rb
114
+ - lib/pebbles/voyage_conference_room/floor.rb
115
+ - lib/pebbles/voyage_conference_room/version.rb
116
+ - pebbles-voyage_conference_room.gemspec
117
+ homepage: https://github.com/fukayatsu/pebbles-voyage_conference_room
118
+ licenses:
119
+ - MIT
120
+ metadata: {}
121
+ post_install_message:
122
+ rdoc_options: []
123
+ require_paths:
124
+ - lib
125
+ required_ruby_version: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ required_rubygems_version: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: '0'
135
+ requirements: []
136
+ rubyforge_project:
137
+ rubygems_version: 2.2.2
138
+ signing_key:
139
+ specification_version: 4
140
+ summary: Floor map of VoyageGroup 8F
141
+ test_files: []