pt 0.2 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/Changelog.md +3 -0
  2. data/lib/pt.rb +1 -1
  3. data/lib/pt/ui.rb +8 -0
  4. metadata +3 -2
data/Changelog.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # pt changelog
2
2
 
3
+ ## v0.2.1
4
+ Error message when using pt from ~
5
+
3
6
  ## v0.2
4
7
  Fix for ruby 1.8
5
8
 
data/lib/pt.rb CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  module PT
4
4
  class InputError < StandardError; end
5
- VERSION = '0.2'
5
+ VERSION = '0.2.1'
6
6
  end
7
7
 
8
8
  require 'pt/client'
data/lib/pt/ui.rb CHANGED
@@ -205,6 +205,7 @@ class PT::UI
205
205
  end
206
206
 
207
207
  def load_local_config
208
+ check_local_config_path
208
209
  config = YAML.load(File.read(LOCAL_CONFIG_PATH)) rescue {}
209
210
  if config.empty?
210
211
  message "I can't find info about this project in #{LOCAL_CONFIG_PATH}"
@@ -220,6 +221,13 @@ class PT::UI
220
221
  config
221
222
  end
222
223
 
224
+ def check_local_config_path
225
+ if GLOBAL_CONFIG_PATH == LOCAL_CONFIG_PATH
226
+ error("Please execute .pt inside your project directory and not in your home.")
227
+ exit
228
+ end
229
+ end
230
+
223
231
  def save_config(config, path)
224
232
  File.new(path, 'w') unless File.exists?(path)
225
233
  File.open(path, 'w') {|f| f.write(config.to_yaml) }
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pt
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- version: "0.2"
9
+ - 1
10
+ version: 0.2.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Raul Murciano