lipsiahosting 1.0.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.
- data/bin/lipsiahosting +61 -0
- data/resources/defaults.yaml +3 -0
- data/tools/rakehelp.rb +104 -0
- metadata +63 -0
data/bin/lipsiahosting
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "rubygems"
|
3
|
+
require "cmdparse"
|
4
|
+
|
5
|
+
cmd = CmdParse::CommandParser.new(true)
|
6
|
+
cmd.program_name = "lipsiahosting"
|
7
|
+
cmd.program_version = [1, 0, 1]
|
8
|
+
cmd.add_command(CmdParse::HelpCommand.new)
|
9
|
+
cmd.add_command(CmdParse::VersionCommand.new)
|
10
|
+
|
11
|
+
# lipsiahosting init
|
12
|
+
init = CmdParse::Command.new("init", false)
|
13
|
+
init.short_desc = "Init a new repository for the given user, ex: lipsiahosting init d.dagostino."
|
14
|
+
init.options = CmdParse::OptionParserWrapper.new do |opt|
|
15
|
+
opt.on( '-i', '--ignore DIRECTORIES', 'Set folder/file to ignore split it by "," ex: "some/folder/*,another/folder/**/*"' ) { |value| $ignores = value }
|
16
|
+
end
|
17
|
+
init.set_execution_block do |args|
|
18
|
+
user = args[0]
|
19
|
+
if !user
|
20
|
+
init.show_help
|
21
|
+
exit 1
|
22
|
+
end
|
23
|
+
ignores = $ignores.split(",") rescue []
|
24
|
+
puts "-> Your username is: #{user}"
|
25
|
+
puts "Removing *.svn folders"
|
26
|
+
system "find . -name .svn -print0 | xargs -0 rm -rf"
|
27
|
+
puts "Removing *.git folders"
|
28
|
+
system "find . -name .git -print0 | xargs -0 rm -rf"
|
29
|
+
puts "Removeing .gitignore"
|
30
|
+
system "rm -rf .gitignore"
|
31
|
+
puts "Initialize the new repository ... DONE"
|
32
|
+
system "git init"
|
33
|
+
path = File.expand_path(".")
|
34
|
+
project = File.basename(path)
|
35
|
+
puts "-> Your current project is: #{project.downcase}"
|
36
|
+
puts "Adding 'log/*' to .gitignore file"
|
37
|
+
system "echo 'log/*'>> .gitignore"
|
38
|
+
puts "Adding 'tmp/*' to .gitignore file"
|
39
|
+
system "echo 'tmp/*'>> .gitignore"
|
40
|
+
puts "Adding '.DS_Store' to .gitignore file"
|
41
|
+
system "echo '.DS_Store'>> .gitignore"
|
42
|
+
puts "Adding 'public/cache/**/*' to .gitignore file"
|
43
|
+
system "echo 'public/cache/**/*'>> .gitignore"
|
44
|
+
if ignores
|
45
|
+
for folder in ignores
|
46
|
+
puts "Adding '#{folder}' to .gitignore file"
|
47
|
+
system "echo '#{folder}'>> .gitignore"
|
48
|
+
end
|
49
|
+
end
|
50
|
+
system "git add .gitignore"
|
51
|
+
puts "Committing application locally"
|
52
|
+
system "git add *"
|
53
|
+
system 'git commit -a -m "initial import of site" > /dev/null'
|
54
|
+
system "git remote add origin git@server1.lipsiasoft.com:#{user}/#{project}.git"
|
55
|
+
puts "Pushing application to the remote server. The name of the branch is:"
|
56
|
+
system "git remote"
|
57
|
+
system "git push origin master"
|
58
|
+
end
|
59
|
+
cmd.add_command(init)
|
60
|
+
|
61
|
+
cmd.parse
|
data/tools/rakehelp.rb
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
|
2
|
+
def make(makedir)
|
3
|
+
Dir.chdir(makedir) do
|
4
|
+
sh(PLATFORM =~ /win32/ ? 'nmake' : 'make')
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
|
9
|
+
def extconf(dir)
|
10
|
+
Dir.chdir(dir) do ruby "extconf.rb" end
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
def setup_tests
|
15
|
+
Rake::TestTask.new do |t|
|
16
|
+
t.libs << "test"
|
17
|
+
t.test_files = FileList['test/test*.rb']
|
18
|
+
t.verbose = true
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
def setup_clean otherfiles
|
24
|
+
files = ['build/*', '**/*.o', '**/*.so', '**/*.a', 'lib/*-*', '**/*.log'] + otherfiles
|
25
|
+
CLEAN.include(files)
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
def setup_rdoc files
|
30
|
+
Rake::RDocTask.new do |rdoc|
|
31
|
+
rdoc.rdoc_dir = 'doc/rdoc'
|
32
|
+
rdoc.options << '--line-numbers'
|
33
|
+
rdoc.rdoc_files.add(files)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
def setup_extension(dir, extension)
|
39
|
+
ext = "ext/#{dir}"
|
40
|
+
ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}"
|
41
|
+
ext_files = FileList[
|
42
|
+
"#{ext}/*.c",
|
43
|
+
"#{ext}/*.h",
|
44
|
+
"#{ext}/extconf.rb",
|
45
|
+
"#{ext}/Makefile",
|
46
|
+
"lib"
|
47
|
+
]
|
48
|
+
|
49
|
+
task "lib" do
|
50
|
+
directory "lib"
|
51
|
+
end
|
52
|
+
|
53
|
+
desc "Builds just the #{extension} extension"
|
54
|
+
task extension.to_sym => ["#{ext}/Makefile", ext_so ]
|
55
|
+
|
56
|
+
file "#{ext}/Makefile" => ["#{ext}/extconf.rb"] do
|
57
|
+
extconf "#{ext}"
|
58
|
+
end
|
59
|
+
|
60
|
+
file ext_so => ext_files do
|
61
|
+
make "#{ext}"
|
62
|
+
cp ext_so, "lib"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
|
67
|
+
def base_gem_spec(pkg_name, pkg_version)
|
68
|
+
pkg_version = pkg_version
|
69
|
+
pkg_name = pkg_name
|
70
|
+
pkg_file_name = "#{pkg_name}-#{pkg_version}"
|
71
|
+
Gem::Specification.new do |s|
|
72
|
+
s.name = pkg_name
|
73
|
+
s.version = pkg_version
|
74
|
+
s.platform = Gem::Platform::RUBY
|
75
|
+
s.has_rdoc = true
|
76
|
+
|
77
|
+
s.files =
|
78
|
+
Dir.glob("{bin,doc/rdoc,test,lib}/**/*") +
|
79
|
+
Dir.glob("ext/**/*.{h,c,rb}") +
|
80
|
+
Dir.glob("examples/**/*.rb") +
|
81
|
+
Dir.glob("tools/*.rb")
|
82
|
+
|
83
|
+
s.require_path = "lib"
|
84
|
+
s.extensions = FileList["ext/**/extconf.rb"].to_a
|
85
|
+
s.bindir = "bin"
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def setup_gem(pkg_name, pkg_version)
|
90
|
+
spec = base_gem_spec(pkg_name, pkg_version)
|
91
|
+
yield spec if block_given?
|
92
|
+
|
93
|
+
Rake::GemPackageTask.new(spec) do |p|
|
94
|
+
p.gem_spec = spec
|
95
|
+
p.need_tar = true
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
def setup_win32_gem(pkg_name, pkg_version)
|
100
|
+
spec = base_gem_spec(pkg_name, pkg_version)
|
101
|
+
yield spec if block_given?
|
102
|
+
|
103
|
+
Gem::Builder.new(spec).build
|
104
|
+
end
|
metadata
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: lipsiahosting
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Davide D'Agostino
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-06-27 00:00:00 +02:00
|
13
|
+
default_executable: lipsiahosting
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: cmdparse
|
17
|
+
version_requirement:
|
18
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: "0"
|
23
|
+
version:
|
24
|
+
description: The Lipsia Hosting task library
|
25
|
+
email: d.dagostino@lipsiasoft.com
|
26
|
+
executables:
|
27
|
+
- lipsiahosting
|
28
|
+
extensions: []
|
29
|
+
|
30
|
+
extra_rdoc_files: []
|
31
|
+
|
32
|
+
files:
|
33
|
+
- bin/lipsiahosting
|
34
|
+
- tools/rakehelp.rb
|
35
|
+
- resources/defaults.yaml
|
36
|
+
has_rdoc: false
|
37
|
+
homepage: http://rails.lipsiasoft.com
|
38
|
+
post_install_message:
|
39
|
+
rdoc_options: []
|
40
|
+
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: "0"
|
48
|
+
version:
|
49
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: "0"
|
54
|
+
version:
|
55
|
+
requirements: []
|
56
|
+
|
57
|
+
rubyforge_project:
|
58
|
+
rubygems_version: 1.1.1
|
59
|
+
signing_key:
|
60
|
+
specification_version: 2
|
61
|
+
summary: The Lipsia Hosting task library
|
62
|
+
test_files: []
|
63
|
+
|