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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7e597ad7e86a86f7d36519d7ce44d1bbd6d3b33b6a6b40bfc24bfa73a556ae4
4
- data.tar.gz: 69c21dc9e0caedbd57444fc0e57cc5b83848d0788fb9a85abf0bef0ef7d27bc6
3
+ metadata.gz: 04e137be69f0ae0a77a93dfdf9738112b17b8aefedc15d267f8335ebb18955de
4
+ data.tar.gz: dd9d9c06717cec2685a704f27d39ae8e8a7742d08df669add0e97b7e6cc71fd9
5
5
  SHA512:
6
- metadata.gz: 708eab5c9114cf1768a759bc20d82af86c93e1a2194a58d80efbcfebd7e6711f271ed574f8f99aacb4d5daaf204258d4cd7d82105b57f61549ccfb6ac646a003
7
- data.tar.gz: a1eade20a5ceca7a97230a00c00bdd29d4c9235a82f41ff4af6bd3ed9eeb3a8add8d96df50a467c3281cf1819730f00496d0c0410989eda1039b4da875dc4895
6
+ metadata.gz: ffbc92b07c0f8cba3ed41cefdc3a077f4edca69242e2e423f1d9b66d149c757b8308daf6735cdb376e839008384a51341beff6a763fccb26969d5f8fb40bed11
7
+ data.tar.gz: e0df9a1340563033ff498c9745904ff8f6d5a3882bfbbbad49d8d835b17dea4715f16513a9f501d9b891eae27519c751e45b8496d4df261c20a247a5e692fa2d
data/.rubocop.yml CHANGED
@@ -20,4 +20,11 @@ Style/Documentation:
20
20
  Enabled: false
21
21
 
22
22
  RSpec/MessageSpies:
23
- EnforcedStyle: receive
23
+ EnforcedStyle: receive
24
+
25
+ Metrics/BlockLength:
26
+ Exclude:
27
+ - "spec/**/*.rb"
28
+
29
+ RSpec/MultipleExpectations:
30
+ Enabled: false
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
@@ -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 = Fusic::Cli::Ruby::VERSION
7
+ spec.version = FusicCliRuby::VERSION
8
8
  spec.authors = ['Yuhei Okazaki']
9
9
  spec.email = ['okazaki@fusic.co.jp']
10
10
 
@@ -12,11 +12,32 @@ module FusicCliRuby
12
12
 
13
13
  desc 'top', 'Open top page.'
14
14
  def top
15
- WebSite.new(Launchy).top
16
- exit
17
- rescue StandardError => e
18
- output_error_if_debug_mode(e)
19
- exit(-1)
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
@@ -1,9 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Fusic
4
- module Cli
5
- module Ruby
6
- VERSION = '0.1.2'
7
- end
8
- end
3
+ module FusicCliRuby
4
+ VERSION = '0.1.3'
9
5
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'fusic_cli_ruby/cli'
4
- require 'fusic_cli_ruby/web_site'
4
+ require 'fusic_cli_ruby/fusic'
5
5
  require 'fusic_cli_ruby/version'
6
6
 
7
7
  module FusicCliRuby
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.2
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