picky-client 2.6.0 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/picky-client.rb CHANGED
@@ -6,4 +6,5 @@ require 'yajl'
6
6
  dir = File.dirname __FILE__
7
7
  require File.expand_path('picky-client/client', dir)
8
8
  require File.expand_path('picky-client/convenience', dir)
9
- require File.expand_path('picky-client/helper', dir)
9
+ require File.expand_path('picky-client/helper', dir)
10
+ require File.expand_path('picky-client/extensions/object', dir)
@@ -0,0 +1,9 @@
1
+ class Object # :nodoc:all
2
+
3
+ # Puts a text that informs the user of a missing gem.
4
+ #
5
+ def warn_gem_missing gem_name, message
6
+ warn "#{gem_name} gem missing!\nTo use #{message}, you need to:\n 1. Add the following line to Gemfile:\n gem '#{gem_name}'\n 2. Then, run:\n bundle update\n"
7
+ end
8
+
9
+ end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ describe Object do
4
+
5
+ context 'basic object' do
6
+ let(:object) { described_class.new }
7
+
8
+ describe 'warn_gem_missing' do
9
+ it 'should warn right' do
10
+ object.should_receive(:warn).once.with "gnorf gem missing!\nTo use gnarble gnarf, you need to:\n 1. Add the following line to Gemfile:\n gem 'gnorf'\n 2. Then, run:\n bundle update\n"
11
+
12
+ object.warn_gem_missing 'gnorf', 'gnarble gnarf'
13
+ end
14
+ end
15
+ end
16
+
17
+ end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: picky-client
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.6.0
5
+ version: 2.7.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Florian Hanke
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-04 00:00:00 +10:00
13
+ date: 2011-07-07 00:00:00 +10:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -48,6 +48,7 @@ files:
48
48
  - lib/picky-client/aux/terminal.rb
49
49
  - lib/picky-client/client.rb
50
50
  - lib/picky-client/convenience.rb
51
+ - lib/picky-client/extensions/object.rb
51
52
  - lib/picky-client/helper.rb
52
53
  - lib/picky-client/spec/support/matchers/have_categories.rb
53
54
  - lib/picky-client/spec/test_client.rb
@@ -64,6 +65,7 @@ files:
64
65
  - spec/picky-client/aux/terminal_spec.rb
65
66
  - spec/picky-client/client_spec.rb
66
67
  - spec/picky-client/convenience_spec.rb
68
+ - spec/picky-client/extensions/object_spec.rb
67
69
  - spec/picky-client/helper_spec.rb
68
70
  - spec/picky-client/spec/test_client_spec.rb
69
71
  has_rdoc: true
@@ -98,5 +100,6 @@ test_files:
98
100
  - spec/picky-client/aux/terminal_spec.rb
99
101
  - spec/picky-client/client_spec.rb
100
102
  - spec/picky-client/convenience_spec.rb
103
+ - spec/picky-client/extensions/object_spec.rb
101
104
  - spec/picky-client/helper_spec.rb
102
105
  - spec/picky-client/spec/test_client_spec.rb