Skip to content
This repository has been archived by the owner on Aug 6, 2023. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
fcoury committed Jan 10, 2010
0 parents commit 34678a3
Show file tree
Hide file tree
Showing 30 changed files with 1,016 additions and 0 deletions.
4 changes: 4 additions & 0 deletions History.txt
@@ -0,0 +1,4 @@
=== 0.0.1 2010-01-10

* 1 major enhancement:
* Initial release
12 changes: 12 additions & 0 deletions Manifest
@@ -0,0 +1,12 @@
History.txt
Manifest
Manifest.txt
PostInstall.txt
README.rdoc
Rakefile
bin/webbynode
lib/wn.rb
oldRakefile
test/test_helper.rb
test/test_webbynode.rb
test/test_wn.rb
11 changes: 11 additions & 0 deletions Manifest.txt
@@ -0,0 +1,11 @@
History.txt
Manifest.txt
PostInstall.txt
README.rdoc
Rakefile
lib/wn.rb
script/console
script/destroy
script/generate
test/test_helper.rb
test/test_wn.rb
12 changes: 12 additions & 0 deletions PostInstall.txt
@@ -0,0 +1,12 @@
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Webbynode deployment gem
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This deployment engine is highly experimental and
should be considered beta code for now.

Commands:

webbynode init Initializes the current app for deployment to a Webby
webbynode push Deploys the current committed code to a Webby

48 changes: 48 additions & 0 deletions README.rdoc
@@ -0,0 +1,48 @@
= wn

* http://github.com/#{github_username}/#{project_name}

== DESCRIPTION:

FIX (describe your package)

== FEATURES/PROBLEMS:

* FIX (list of features or problems)

== SYNOPSIS:

FIX (code sample of usage)

== REQUIREMENTS:

* FIX (list of requirements)

== INSTALL:

* FIX (sudo gem install, anything else)

== LICENSE:

(The MIT License)

Copyright (c) 2010 FIXME full name

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
55 changes: 55 additions & 0 deletions Rakefile
@@ -0,0 +1,55 @@
require 'rubygems'
require 'rake'
require 'rake/testtask'

require 'echoe'

Echoe.new('webbynode', '0.1.0') do |p|
p.description = "Webbynode Deployment Gem"
p.url = "http://webbynode.com"
p.author = "Felipe Coury"
p.email = "felipe@webbynode.com"
p.ignore_pattern = ["tmp/*", "script/*"]
# p.dependencies = [
# ['activeresource','>= 2.3.4'],
# ['activesupport','>= 2.3.4'],
# ['rainbow', '>=1.0.4'],
# ['highline', '>=1.5.1'],
# ['httparty', '>=0.4.5']
# ]
p.install_message = <<EOS
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Webbynode deployment gem
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This deployment engine is highly experimental and
should be considered beta code for the time being.
Commands:
webbynode init Initializes the current app for deployment to a Webby
webbynode push Deploys the current committed code to a Webby
EOS
end
#
# Rake::TestTask.new(:test_new) do |test|
# test.libs << 'test'
# test.ruby_opts << '-rubygems'
# test.pattern = 'test/**/test_*.rb'
# test.verbose = true
# end

require 'rcov/rcovtask'
desc 'Measures test coverage using rcov'
namespace :rcov do
desc 'Output unit test coverage of plugin.'
Rcov::RcovTask.new(:unit) do |rcov|
rcov.libs << 'test'
rcov.ruby_opts << '-rubygems'
rcov.pattern = 'test/unit/**/test_*.rb'
rcov.output_dir = 'rcov'
rcov.verbose = true
rcov.rcov_opts << '--exclude "gems/*"'
end
end
7 changes: 7 additions & 0 deletions bin/webbynode
@@ -0,0 +1,7 @@
#!/usr/bin/env ruby
$:.unshift File.dirname(__FILE__)+"/../lib"
require 'rubygems'
require 'wn'

app = Wn::App.new(ARGV)
app.run
96 changes: 96 additions & 0 deletions lib/wn.rb
@@ -0,0 +1,96 @@
$:.unshift(File.dirname(__FILE__)) unless
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))

require 'pp'

module Wn
VERSION = '0.0.1'

class App
attr_accessor :command
attr_accessor :params

def initialize(command)
parse command
end

def run
send command
end

def parse(parts)
@command = parts.shift
@params = parts
end

def push
unless dir_exists(".git")
out "Not an application or missing initialization. Use 'webbynode init'."
return
end

out "Publishing #{app_name} to Webbynode..."
exec "git push webbynode master"
end

def init
if params.size < 2
out "usage: wn init [webby_ip] [host]"
return
end

webby_ip, host = *params

unless dir_exists(".git")
out "Initializing git repository..."
git_init webby_ip
end

unless file_exists(".pushand")
out "Initializing deployment descriptor for #{host}..."
create_file ".pushand", "#! /bin/bash\nphd $0 #{host}\n"
end

unless file_exists(".gitignore")
out "Creating .gitignore file..."
create_file ".gitignore", <<EOS
config/database.yml
log/*
tmp/*
db/*.sqlite3
EOS
end
end

def git_init(ip)
exec "git init"

exec "git remote add webbynode git@#{ip}:#{app_name}"

exec "git add ."
exec "git commit -m \"Initial commit\""
end

def app_name
Dir.pwd.split("/").last
end

def dir_exists(dir)
File.directory?(dir)
end

def out(line)
puts line
end

def file_exists(file)
File.exists?(file)
end

def create_file(filename, contents)
File.open(filename, "w") do |file|
file.write(contents)
end
end
end
end
26 changes: 26 additions & 0 deletions oldRakefile
@@ -0,0 +1,26 @@
require 'rubygems'
gem 'hoe', '>= 2.1.0'
require 'hoe'
require 'fileutils'
require './lib/wn'

Hoe.plugin :newgem
# Hoe.plugin :website
# Hoe.plugin :cucumberfeatures

# Generate all the Rake tasks
# Run 'rake -T' to see list of generated tasks (from gem root directory)
$hoe = Hoe.spec 'wn' do
self.developer 'Felipe Coury', 'felipe@webbynode.com'
self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
self.rubyforge_name = self.name # TODO this is default value
# self.extra_deps = [['activesupport','>= 2.0.2']]

end

require 'newgem/tasks'
Dir['tasks/**/*.rake'].each { |t| load t }

# TODO - want other tests/tasks run by default? Add them to the list
# remove_task :default
# task :default => [:spec, :features]
Binary file added pkg/webbynode-0.1.0.gem
Binary file not shown.
Binary file added pkg/webbynode-0.1.0.tar.gz
Binary file not shown.
4 changes: 4 additions & 0 deletions pkg/webbynode-0.1.0/History.txt
@@ -0,0 +1,4 @@
=== 0.0.1 2010-01-10

* 1 major enhancement:
* Initial release
12 changes: 12 additions & 0 deletions pkg/webbynode-0.1.0/Manifest
@@ -0,0 +1,12 @@
History.txt
Manifest
Manifest.txt
PostInstall.txt
README.rdoc
Rakefile
bin/webbynode
lib/wn.rb
oldRakefile
test/test_helper.rb
test/test_webbynode.rb
test/test_wn.rb
11 changes: 11 additions & 0 deletions pkg/webbynode-0.1.0/Manifest.txt
@@ -0,0 +1,11 @@
History.txt
Manifest.txt
PostInstall.txt
README.rdoc
Rakefile
lib/wn.rb
script/console
script/destroy
script/generate
test/test_helper.rb
test/test_wn.rb
12 changes: 12 additions & 0 deletions pkg/webbynode-0.1.0/PostInstall.txt
@@ -0,0 +1,12 @@
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Webbynode deployment gem
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This deployment engine is highly experimental and
should be considered beta code for now.

Commands:

webbynode init Initializes the current app for deployment to a Webby
webbynode push Deploys the current committed code to a Webby

48 changes: 48 additions & 0 deletions pkg/webbynode-0.1.0/README.rdoc
@@ -0,0 +1,48 @@
= wn

* http://github.com/#{github_username}/#{project_name}

== DESCRIPTION:

FIX (describe your package)

== FEATURES/PROBLEMS:

* FIX (list of features or problems)

== SYNOPSIS:

FIX (code sample of usage)

== REQUIREMENTS:

* FIX (list of requirements)

== INSTALL:

* FIX (sudo gem install, anything else)

== LICENSE:

(The MIT License)

Copyright (c) 2010 FIXME full name

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 comments on commit 34678a3

Please sign in to comment.