ana 0.9.4 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd6dc3594ee445bfef54767794e7bb1eaf5b668f
4
- data.tar.gz: 2b8b041844620b803938dd359d1f7bc110ce2017
3
+ metadata.gz: c64cc8ef588e15faa6f6767849a6d581f737819b
4
+ data.tar.gz: edbea1ec7cd4fa7bdfc1e37edbaed7dc3ae1d0fe
5
5
  SHA512:
6
- metadata.gz: 6dd7b5db308bc2003a246bd33fa3c817178e55cc04ccaa15068c8b5c2e093b3a4d61cb3ea785b89bfe3b95298fd29725f4f9b8338b6ba03b1c8219e7767fcb00
7
- data.tar.gz: e92dc593ae148b8458b0f523e982173ca654499576ffe25fdf690aba3667c54ee9e7a4ef39533aa1274a110460c35a3feb17570c16851eabe0ffa9a9d44120b2
6
+ metadata.gz: 93ed9589d3e91d627b2f86f26e1ac71b285257d717b9bdf7a03b868cc7f13812aaa1a90836d69f033b92579fb9e5f445761a3388ac1b98b310c20cd5fd3e1fc1
7
+ data.tar.gz: e8ff9b905804e334816d9062e9837884c0ad58c82668faca705ff04f7e5163d52526c2077632432b5b13d0c5348d18a39455dab47bb786a65a39d7a8653a5223
data/ana.gemspec CHANGED
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.add_dependency 'thor', '~> 0.18.1'
24
24
  spec.add_dependency 'launchy', '~> 2.4.2'
25
+ spec.add_dependency 'activesupport', '~> 4.0.1'
25
26
 
26
27
  spec.add_development_dependency 'bundler', '>= 1.4'
27
28
  spec.add_development_dependency 'rake', '>= 10.1.0'
data/lib/ana/command.rb CHANGED
@@ -2,6 +2,7 @@ require 'thor'
2
2
  require 'net/http'
3
3
  require 'json'
4
4
  require 'launchy'
5
+ require 'active_support/core_ext/object/blank'
5
6
 
6
7
  module Ana
7
8
  class Command < Thor
@@ -125,10 +126,11 @@ module Ana
125
126
  system("gem search -r #{Shellwords.escape gem}")
126
127
  end
127
128
 
128
- # Open the URIs of a given Gem.
129
+ # FIXME: Only print the uri type if it is not null
130
+ # Open the URIs of a given Gem. Default open the home page.
129
131
  # Available URI types could be found in Ana::Scalars::URI_TYPE.
130
- desc 'open (o)', 'Open gem doc directly via open command.'
131
- def open(gem, open_type='doc')
132
+ desc 'open (o)', 'Open gem's uris directly via open command.'
133
+ def open(gem, open_type='home')
132
134
  return if gem_does_not_exist?(gem)
133
135
  gem_hash = get_gem_json!(gem, type: 'gems')
134
136
  url = if URI_TYPE.keys.include? open_type
@@ -138,7 +140,7 @@ module Ana
138
140
  say "#{open_type} is not a valid type :( \n"
139
141
  print_valid_uri_open_types!
140
142
  skip = true
141
- gem_hash[URI_TYPE['doc']]
143
+ gem_hash[URI_TYPE[type]]
142
144
  end
143
145
  Launchy.open(url) if url.present? && skip == false
144
146
  end
data/lib/ana/version.rb CHANGED
@@ -2,7 +2,7 @@ module Ana
2
2
  module VERSION
3
3
  MAJOR = 0
4
4
  MINOR = 9
5
- TINY = 4
5
+ TINY = 5
6
6
  PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
data/lib/ana.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require_relative "ana/version"
2
- require_relative "ana/core_ext"
3
2
  require_relative "ana/constants"
4
3
  require_relative "ana/command"
5
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ana
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juanito Fatas
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: 2.4.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: activesupport
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 4.0.1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 4.0.1
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: bundler
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -84,7 +98,6 @@ files:
84
98
  - lib/ana.rb
85
99
  - lib/ana/command.rb
86
100
  - lib/ana/constants.rb
87
- - lib/ana/core_ext.rb
88
101
  - lib/ana/version.rb
89
102
  - test/ana/ana_test.rb
90
103
  - test/test_helper.rb
data/lib/ana/core_ext.rb DELETED
@@ -1,16 +0,0 @@
1
- class String
2
- # A string is present if it's not a blank string.
3
- def present?
4
- !blank?
5
- end
6
-
7
- # A string is blank if it's empty or contains whitespaces only:
8
- #
9
- # ''.blank? # => true
10
- # ' '.blank? # => true
11
- # ' '.blank? # => true
12
- # ' something here '.blank? # => false
13
- def blank?
14
- self =~ /\A[[:space:]]*\z/
15
- end
16
- end