mozzn 0.3.0 → 0.3.1

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
  SHA1:
3
- metadata.gz: b32a146475f55c41943db377119d126dbca9fd00
4
- data.tar.gz: 55019427b77f4474b78092e62919a15ae23ebfce
3
+ metadata.gz: 454e5a3c7cc085d45c2fafcd2d5e9b4deca671d6
4
+ data.tar.gz: dbf48df77a6d527f31d77b1c9549382d92cc1ce7
5
5
  SHA512:
6
- metadata.gz: 3b02f8b487ed7fc49018937888d143f384ac6b2bdc2d48de869c54d078681920784101989c8f6cffa20e9be194bd0566c0f2c6edc4bd76b16e10fd25a66c8d04
7
- data.tar.gz: 928091596f1ae6d18583b198208b6801fa5517ecb37def5be973addd8b278723935e1375c46128ba24f02359a3b50dc2c4f19b1fa276d33fc5d55fb14386b324
6
+ metadata.gz: cb0f39b1ff4c33ea5496ff1950ce1b4a0aa7bbdaa821afbfcdf59f9fe29e7f261fa4a428471f988447f77a8bba8de4b04b41674a6b51ef9415611359cb5aef0e
7
+ data.tar.gz: ff490d0b66bc7ac52037bbca27ba3c501650faa8fe865f5c15ea0b2ebde9bbafd34c703c4e2bc2efdee7734a9048af43b34d1d4da176681d3c70afcb0ac3c268
@@ -1,3 +1,5 @@
1
+ require 'parseconfig'
2
+
1
3
  module Mozzn
2
4
  module Commands
3
5
  class App < Thor
@@ -21,7 +23,7 @@ module Mozzn
21
23
  }
22
24
  response = mozzn.post(path, params)
23
25
  if response.has_key?('message')
24
- raise Thor::Error, "#{response['message']}"
26
+ raise Thor::Error, "#{response['message']}."
25
27
  else
26
28
  say response['info'], :green
27
29
  git = Git.init
@@ -36,7 +38,7 @@ module Mozzn
36
38
  begin
37
39
  git.add_remote("mozzn", "git@git.mozzn.com:#{name}.git")
38
40
  rescue Git::GitExecuteError => e
39
- say 'Git remote already configured, skipping...'
41
+ say 'Git remote already configured, skipping.'
40
42
  end
41
43
  end
42
44
  rescue Mozzn::Disconnected
@@ -65,7 +67,7 @@ module Mozzn
65
67
  begin
66
68
  response = mozzn.get(search_path, params)
67
69
  if response.has_key?('info')
68
- raise Thor::Error, "#{response['info']}"
70
+ raise Thor::Error, "#{response['info']}."
69
71
  else
70
72
  id = response['app_id']
71
73
  resources_path = "applications/#{id}/remove"
@@ -80,7 +82,7 @@ module Mozzn
80
82
  rescue Mozzn::UnexpectedOutput
81
83
  say 'UnexpectedOutput', :red
82
84
  end
83
- desc "list", "List all your Applications."
85
+ desc "list", "List all your Applications"
84
86
 
85
87
  def list
86
88
  #TODO
@@ -205,16 +207,16 @@ module Mozzn
205
207
  desc 'appname', 'Get application name'
206
208
  def appname
207
209
  config_file_path = ".git/config"
208
- if File.exists?(config_file_path)
209
- File.open(config_file_path, "r") do |f|
210
- @data = f.read
211
- end
212
- else
213
- raise Thor::Error,"Unable to find a repository for this directory. You probably not in the application directory or this application does not have git repository yet."
210
+ unless File.exists?(config_file_path)
211
+ raise Thor::Error,"Unable to find a Git repository for this directory. You are probably not in the application directory or this application does not have a Git repository yet."
212
+ end
213
+ config = ParseConfig.new(config_file_path)
214
+ our_key = 'remote "mozzn"'
215
+ unless config.get_groups.include?(our_key)
216
+ raise Thor::Error,"Unable to find a Git repository for this directory. You are probably not in the application directory or this application does not have a Git repository yet."
214
217
  end
215
- url = @data.scan /url =.*/
216
- app = url.first.split(":")[1]
217
- appname = app.split('.').first
218
+ url = config['remote "mozzn"']['url']
219
+ appname = url.split(':').last.split('.').first
218
220
  end
219
221
  end
220
222
  end
data/lib/mozzn/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mozzn
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
data/mozzn.gemspec CHANGED
@@ -28,5 +28,6 @@ Gem::Specification.new do |spec|
28
28
  spec.add_dependency "cocaine"
29
29
  spec.add_dependency "git"
30
30
  spec.add_dependency "terminal-table"
31
+ spec.add_dependency "parseconfig"
31
32
 
32
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mozzn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - mozzn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-17 00:00:00.000000000 Z
11
+ date: 2014-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - '>='
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: parseconfig
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
139
153
  description: Command Line Interface to mozzn
140
154
  email:
141
155
  - info@mozzn.com
@@ -197,4 +211,3 @@ test_files:
197
211
  - spec/cli_spec.rb
198
212
  - spec/key_spec.rb
199
213
  - spec/spec_helper.rb
200
- has_rdoc: