app_fog 1.0.5 → 1.0.6

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.
data/app_fog.gemspec CHANGED
@@ -1,10 +1,10 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'app_fog'
3
- s.version = '1.0.5'
3
+ s.version = '1.0.6'
4
4
  s.date = '2013-06-12'
5
5
  s.summary = "A wrapper for the app fog command line interface."
6
- s.description = "Wrapping the app fog CLI into a gem to help you deploy more easily.
7
- Don't forget to install the af CLI using 'gem install af'. You can only update and start at the moment.
6
+ s.description = "Wrapping the app fog CLI into a gem to help you deploy more easily.
7
+ Don't forget to install the af CLI using 'gem install af'. You can only update and start at the moment.
8
8
  Tweet @ruby_gem if you want more, or fork the code."
9
9
  s.authors = ["@ruby_gem"]
10
10
  s.email = 'gemma.cameron@gmail.com'
@@ -13,5 +13,4 @@ Gem::Specification.new do |s|
13
13
  s.test_files = ['test/test_app_fog.rb', 'test/test_shell_command_wrapper.rb']
14
14
  s.homepage = 'http://rubygems.org/gems/app_fog'
15
15
  s.add_dependency "af"
16
-
17
16
  end
@@ -8,6 +8,7 @@ class ShellCommandWrapper
8
8
  def perform(command)
9
9
  stdin, stdout, stderr = @open3.popen3 command
10
10
  output = stdout.read unless stdout == nil
11
+ output << stderr.read unless stderr == nil
11
12
 
12
13
  puts output
13
14
 
data/lib/app_fog.rb CHANGED
@@ -18,6 +18,12 @@ class AppFog
18
18
  @shell_command.perform "af update #{app_name}"
19
19
  end
20
20
 
21
+ def update_from_directory(parameters)
22
+ app_name = parameters[:app_name]
23
+ directory = parameters[:directory]
24
+ @shell_command.perform "af update #{app_name} --path #{directory}"
25
+ end
26
+
21
27
  def start(app_name)
22
28
  @shell_command.perform "af start #{app_name}"
23
29
  end
data/rakefile.rb CHANGED
@@ -1,7 +1,9 @@
1
1
  require 'rake/testtask'
2
2
 
3
- Rake::TestTask.new do |t|
4
- t.libs << "lib"
5
- t.test_files = FileList['test/test*.rb']
6
- t.verbose = true
7
- end
3
+ task :default => [:test]
4
+
5
+ Rake::TestTask.new do |test_run|
6
+ test_run.libs << "lib"
7
+ test_run.test_files = FileList['test/*.rb']
8
+ test_run.verbose = true
9
+ end
data/test/test_app_fog.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'test/unit'
2
- require '../lib/app_fog.rb'
2
+ require_relative '../lib/app_fog.rb'
3
3
 
4
4
  class TestAppFog < Test::Unit::TestCase
5
5
  def test_login
@@ -11,6 +11,13 @@ class TestAppFog < Test::Unit::TestCase
11
11
  appfog = AppFog.new(username: 'username', password: 'password', shell_command: self)
12
12
  appfog.update('app-name')
13
13
  assert_equal 'af update app-name', @command
14
+ end
15
+
16
+ def test_update_from_directory
17
+ directory = "./aDirectory"
18
+ appfog = AppFog.new(shell_command: self)
19
+ appfog.update_from_directory(app_name: 'app-name', directory: directory)
20
+ assert_equal "af update app-name --path #{directory}", @command
14
21
  end
15
22
 
16
23
  def test_start
@@ -22,15 +29,4 @@ class TestAppFog < Test::Unit::TestCase
22
29
  def perform(command)
23
30
  @command = command
24
31
  end
25
- end
26
-
27
- class AppFogIntegrationTest < Test::Unit::TestCase
28
- def test_start
29
- appfog = AppFog.new(username: 'username', password: 'password')
30
- appfog.update('app-name')
31
- appfog.start('app-name')
32
- end
33
- end
34
-
35
-
36
-
32
+ end
@@ -1,5 +1,5 @@
1
1
  require 'test/unit'
2
- require '../lib/app_fog/shell_command_wrapper.rb'
2
+ require_relative '../lib/app_fog/shell_command_wrapper.rb'
3
3
 
4
4
  class TestShellCommandWrapper < Test::Unit::TestCase
5
5
  def test_send_command
@@ -13,7 +13,7 @@ class TestShellCommandWrapper < Test::Unit::TestCase
13
13
  assert_raise LoginError do
14
14
  shell = ShellCommandWrapper.new(self)
15
15
  shell.perform('af login --email username --passwd password')
16
- end
16
+ end
17
17
  end
18
18
 
19
19
  def popen3(command)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_fog
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -27,10 +27,10 @@ dependencies:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
- description: ! "Wrapping the app fog CLI into a gem to help you deploy more easily.
31
- \n Don't forget to install the af CLI using 'gem install af'.
32
- You can only update and start at the moment. \n Tweet @ruby_gem
33
- if you want more, or fork the code."
30
+ description: ! "Wrapping the app fog CLI into a gem to help you deploy more easily.\n
31
+ \ Don't forget to install the af CLI using 'gem install af'. You
32
+ can only update and start at the moment.\n Tweet @ruby_gem if
33
+ you want more, or fork the code."
34
34
  email: gemma.cameron@gmail.com
35
35
  executables: []
36
36
  extensions: []