rupi 0.2.4 → 0.3.0

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.
@@ -0,0 +1,49 @@
1
+ require 'sprinkle'
2
+
3
+ Capistrano::Configuration.instance(:must_exist).load do
4
+
5
+ namespace :deploy do
6
+ desc 'prepare your raspberry pi for deployment'
7
+ task :setup do
8
+ sprinkle_path = Gem.find_files('rupi/sprinkle.rb').first
9
+ $user = fetch(:user)
10
+ $raspberypis = find_servers(:roles => :raspberrypi).first.host
11
+ Sprinkle::Script.sprinkle(File.read(sprinkle_path), sprinkle_path)
12
+
13
+ run "mkdir -p #{deploy_to}"
14
+
15
+ update_code
16
+ bundle
17
+ setup_service
18
+ end
19
+
20
+ task :setup_service do
21
+ run "bash -c 'source /etc/profile.d/rvm.sh && cd #{deploy_to} && bundle exec rupi_service install app.rb'"
22
+ end
23
+
24
+ desc 'deploy the app'
25
+ task :default do
26
+ stop
27
+ update_code
28
+ bundle
29
+ start
30
+ end
31
+
32
+ task :stop do
33
+ run "sudo /etc/init.d/rupi_service stop"
34
+ end
35
+
36
+ task :start do
37
+ run "sudo /etc/init.d/rupi_service start"
38
+ end
39
+
40
+ task :update_code do
41
+ upload("#{File.dirname(__FILE__)}", "#{deploy_to}", :via => :scp, :recursive => true)
42
+ end
43
+
44
+ task :bundle do
45
+ run "bash -c 'source /etc/profile.d/rvm.sh && cd #{deploy_to} && bundle check || bundle --deployment'"
46
+ end
47
+ end
48
+
49
+ end
data/lib/rupi/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Rupi
2
- VERSION = '0.2.4'
2
+ VERSION = '0.3.0'
3
3
  RUBY_VERSION = 'ruby-1.9.3-p194'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rupi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-22 00:00:00.000000000 Z
12
+ date: 2012-10-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: wiringpi
@@ -71,6 +71,7 @@ files:
71
71
  - bin/rupi
72
72
  - bin/rupi_service
73
73
  - lib/rupi/camera.rb
74
+ - lib/rupi/capistrano.rb
74
75
  - lib/rupi/pin.rb
75
76
  - lib/rupi/sprinkle.rb
76
77
  - lib/rupi/version.rb
@@ -90,7 +91,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
90
91
  version: '0'
91
92
  segments:
92
93
  - 0
93
- hash: 1382266704318263339
94
+ hash: 2490160822493161451
94
95
  required_rubygems_version: !ruby/object:Gem::Requirement
95
96
  none: false
96
97
  requirements:
@@ -99,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
100
  version: '0'
100
101
  segments:
101
102
  - 0
102
- hash: 1382266704318263339
103
+ hash: 2490160822493161451
103
104
  requirements: []
104
105
  rubyforge_project:
105
106
  rubygems_version: 1.8.24