fusic-cli-ruby 0.1.2 → 0.1.3
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/.rubocop.yml +8 -1
- data/Guardfile +24 -0
- data/fusic-cli-ruby.gemspec +1 -1
- data/lib/fusic_cli_ruby/cli.rb +35 -5
- data/lib/fusic_cli_ruby/fusic.rb +48 -0
- data/lib/fusic_cli_ruby/version.rb +2 -6
- data/lib/fusic_cli_ruby.rb +1 -1
- metadata +3 -2
- data/lib/fusic_cli_ruby/web_site.rb +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04e137be69f0ae0a77a93dfdf9738112b17b8aefedc15d267f8335ebb18955de
|
4
|
+
data.tar.gz: dd9d9c06717cec2685a704f27d39ae8e8a7742d08df669add0e97b7e6cc71fd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffbc92b07c0f8cba3ed41cefdc3a077f4edca69242e2e423f1d9b66d149c757b8308daf6735cdb376e839008384a51341beff6a763fccb26969d5f8fb40bed11
|
7
|
+
data.tar.gz: e0df9a1340563033ff498c9745904ff8f6d5a3882bfbbbad49d8d835b17dea4715f16513a9f501d9b891eae27519c751e45b8496d4df261c20a247a5e692fa2d
|
data/.rubocop.yml
CHANGED
data/Guardfile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
guard :rspec, cmd: 'bundle exec rspec' do
|
4
|
+
require 'guard/rspec/dsl'
|
5
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
6
|
+
|
7
|
+
# Feel free to open issues for suggestions and improvements
|
8
|
+
|
9
|
+
# RSpec files
|
10
|
+
rspec = dsl.rspec
|
11
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
12
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
13
|
+
watch(rspec.spec_files)
|
14
|
+
|
15
|
+
# Ruby files
|
16
|
+
ruby = dsl.ruby
|
17
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
18
|
+
dsl.watch_spec_files_for(%r{^(exe/.+)\.rb$})
|
19
|
+
end
|
20
|
+
|
21
|
+
guard :rubocop, cli: %w[-a] do
|
22
|
+
watch(/.+\.rb$/)
|
23
|
+
watch(%r{(?:.+/)?\.rubocop(?:_todo)?\.yml$}) { |m| File.dirname(m[0]) }
|
24
|
+
end
|
data/fusic-cli-ruby.gemspec
CHANGED
@@ -4,7 +4,7 @@ require_relative 'lib/fusic_cli_ruby/version'
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'fusic-cli-ruby'
|
7
|
-
spec.version =
|
7
|
+
spec.version = FusicCliRuby::VERSION
|
8
8
|
spec.authors = ['Yuhei Okazaki']
|
9
9
|
spec.email = ['okazaki@fusic.co.jp']
|
10
10
|
|
data/lib/fusic_cli_ruby/cli.rb
CHANGED
@@ -12,11 +12,32 @@ module FusicCliRuby
|
|
12
12
|
|
13
13
|
desc 'top', 'Open top page.'
|
14
14
|
def top
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
execute { puts Fusic.new(Launchy).top }
|
16
|
+
end
|
17
|
+
|
18
|
+
desc 'members', 'Open members page.'
|
19
|
+
def members
|
20
|
+
execute { puts Fusic.new(Launchy).members }
|
21
|
+
end
|
22
|
+
|
23
|
+
desc 'outline', 'Open company/outline page.'
|
24
|
+
def outline
|
25
|
+
execute { puts Fusic.new(Launchy).company_outline }
|
26
|
+
end
|
27
|
+
|
28
|
+
desc 'techblog', 'Open techblog top page.'
|
29
|
+
def techblog
|
30
|
+
execute { puts Fusic.new(Launchy).techblog }
|
31
|
+
end
|
32
|
+
|
33
|
+
desc 'blog', 'Open blog top page.'
|
34
|
+
def blog
|
35
|
+
execute { puts Fusic.new(Launchy).blog }
|
36
|
+
end
|
37
|
+
|
38
|
+
desc 'news', 'Open news top page.'
|
39
|
+
def news
|
40
|
+
execute { puts Fusic.new(Launchy).news }
|
20
41
|
end
|
21
42
|
|
22
43
|
map %w[--version -v] => :version
|
@@ -27,6 +48,15 @@ module FusicCliRuby
|
|
27
48
|
|
28
49
|
private
|
29
50
|
|
51
|
+
def execute
|
52
|
+
yield
|
53
|
+
puts ''
|
54
|
+
exit
|
55
|
+
rescue StandardError => e
|
56
|
+
output_error_if_debug_mode(e)
|
57
|
+
exit(-1)
|
58
|
+
end
|
59
|
+
|
30
60
|
def output_error_if_debug_mode(exception)
|
31
61
|
return unless options[:debug]
|
32
62
|
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'thor'
|
4
|
+
require 'launchy'
|
5
|
+
require 'fusic_cli_ruby'
|
6
|
+
|
7
|
+
module FusicCliRuby
|
8
|
+
class Fusic
|
9
|
+
def initialize(launcher)
|
10
|
+
@launcher = launcher
|
11
|
+
end
|
12
|
+
|
13
|
+
def top
|
14
|
+
open('https://fusic.co.jp/')
|
15
|
+
end
|
16
|
+
|
17
|
+
def members
|
18
|
+
open('https://fusic.co.jp/members')
|
19
|
+
end
|
20
|
+
|
21
|
+
def company_outline
|
22
|
+
open('https://fusic.co.jp/company/outline')
|
23
|
+
end
|
24
|
+
|
25
|
+
def techblog
|
26
|
+
open('https://tech.fusic.co.jp/')
|
27
|
+
end
|
28
|
+
|
29
|
+
def blog
|
30
|
+
open('https://fusic.co.jp/doings/')
|
31
|
+
end
|
32
|
+
|
33
|
+
def news
|
34
|
+
open('https://fusic.co.jp/news/')
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def open(url)
|
40
|
+
@launcher.open(url, options)
|
41
|
+
url
|
42
|
+
end
|
43
|
+
|
44
|
+
def options
|
45
|
+
{ dry_run: ENV['LAUNCHY_DRY_RUN'] == '1' }
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/lib/fusic_cli_ruby.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fusic-cli-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuhei Okazaki
|
@@ -51,6 +51,7 @@ files:
|
|
51
51
|
- ".rubocop.yml"
|
52
52
|
- ".travis.yml"
|
53
53
|
- Gemfile
|
54
|
+
- Guardfile
|
54
55
|
- README.md
|
55
56
|
- Rakefile
|
56
57
|
- bin/console
|
@@ -59,8 +60,8 @@ files:
|
|
59
60
|
- fusic-cli-ruby.gemspec
|
60
61
|
- lib/fusic_cli_ruby.rb
|
61
62
|
- lib/fusic_cli_ruby/cli.rb
|
63
|
+
- lib/fusic_cli_ruby/fusic.rb
|
62
64
|
- lib/fusic_cli_ruby/version.rb
|
63
|
-
- lib/fusic_cli_ruby/web_site.rb
|
64
65
|
homepage: https://github.com/fusic/fusic-cli-ruby
|
65
66
|
licenses: []
|
66
67
|
metadata:
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'thor'
|
4
|
-
require 'launchy'
|
5
|
-
require 'fusic_cli_ruby'
|
6
|
-
|
7
|
-
module FusicCliRuby
|
8
|
-
class WebSite
|
9
|
-
def initialize(launcher)
|
10
|
-
@launcher = launcher
|
11
|
-
end
|
12
|
-
|
13
|
-
def top(options = {})
|
14
|
-
url = 'https://fusic.co.jp/'
|
15
|
-
@launcher.open(url, options)
|
16
|
-
puts url
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|