transender 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitattributes +1 -0
- data/.gitignore +21 -0
- data/.gitmodules +3 -0
- data/History.txt +4 -0
- data/LICENSE +20 -0
- data/README.rdoc +48 -0
- data/README.txt +72 -0
- data/Rakefile +50 -0
- data/VERSION.yml +4 -0
- data/bin/transender +31 -0
- data/lib/tasks/pushup.rake +7 -0
- data/lib/transender.rb +178 -0
- data/spec/spec_helper.rb +16 -0
- data/spec/transender_spec.rb +49 -0
- data/test/test_transender.rb +12 -0
- data/test/test_transender.sh +5 -0
- data/transender.gemspec +58 -0
- metadata +75 -0
data/.gitattributes
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
*.pbxproj -crlf -diff -merge
|
data/.gitignore
ADDED
data/.gitmodules
ADDED
data/History.txt
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Mihael
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
= transender
|
2
|
+
|
3
|
+
Use Transender whenever you need to git-clone and rename XCode iPhone SDK projects.
|
4
|
+
|
5
|
+
Project home: http://kitschmaster.com/kiches/246
|
6
|
+
|
7
|
+
== FEATURES/NO-PROBLEMS:
|
8
|
+
|
9
|
+
* can clone XCode projects (on git) and rename them successfully (tested only on iPhone/iPod Touch projects)
|
10
|
+
* use from command line or ruby program
|
11
|
+
|
12
|
+
== SYNOPSIS:
|
13
|
+
|
14
|
+
You could use it in a Rails app maybe like this:
|
15
|
+
|
16
|
+
Transender::Ji.transform_and_zip({:app_title=>"myClonedProject", :transform=>"git://github.com/mihael/iproject.git", :ji_path => File.join(File.dirname(__FILE__), %w[.. tmp]) }) do |zip|
|
17
|
+
render :text => zip
|
18
|
+
end
|
19
|
+
|
20
|
+
Or on the command line, like this:
|
21
|
+
|
22
|
+
transender git://github.com/mihael/iproject.git myFreshProject /projects/
|
23
|
+
|
24
|
+
== REQUIREMENTS:
|
25
|
+
|
26
|
+
Nothing you would not have. Only the simple tools.
|
27
|
+
|
28
|
+
* sed
|
29
|
+
* tar
|
30
|
+
* git
|
31
|
+
* ruby
|
32
|
+
|
33
|
+
== INSTALL:
|
34
|
+
|
35
|
+
GitHub style:
|
36
|
+
|
37
|
+
* gem sources -a http://gems.github.com
|
38
|
+
* sudo gem install mihael-transender
|
39
|
+
|
40
|
+
RubyForge style:
|
41
|
+
|
42
|
+
* sudo gem install transender
|
43
|
+
|
44
|
+
== Copyright
|
45
|
+
|
46
|
+
Copyright (c) 2009 Mihael. See LICENSE for details.
|
47
|
+
|
48
|
+
|
data/README.txt
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
transender
|
2
|
+
by KitschMaster
|
3
|
+
kitschmaster.com
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
Use Transender whenever you need to git-clone and rename XCode iPhone SDK projects.
|
8
|
+
|
9
|
+
Project home: http://kitschmaster.com/kiches/246
|
10
|
+
|
11
|
+
|
12
|
+
== FEATURES/PROBLEMS:
|
13
|
+
|
14
|
+
* can clone XCode projects (on git) and rename them successfully (tested only on iPhone/iPod Touch projects)
|
15
|
+
* use from command line or ruby program
|
16
|
+
|
17
|
+
== SYNOPSIS:
|
18
|
+
|
19
|
+
You could use it in a Rails app maybe like this:
|
20
|
+
|
21
|
+
Transender::Ji.transform_and_zip({:app_title=>"myClonedProject", :transform=>"git://github.com/mihael/iproject.git", :ji_path => File.join(File.dirname(__FILE__), %w[.. tmp]) }) do |zip|
|
22
|
+
render :text => zip
|
23
|
+
end
|
24
|
+
|
25
|
+
Or on the command line, like this:
|
26
|
+
|
27
|
+
transender git://github.com/mihael/iproject.git myFreshProject /projects/
|
28
|
+
|
29
|
+
== REQUIREMENTS:
|
30
|
+
|
31
|
+
Nothing you would not have. Only the simple tools.
|
32
|
+
|
33
|
+
* sed
|
34
|
+
* tar
|
35
|
+
* git
|
36
|
+
* ruby
|
37
|
+
|
38
|
+
== INSTALL:
|
39
|
+
|
40
|
+
GitHub style:
|
41
|
+
|
42
|
+
* gem sources -a http://gems.github.com
|
43
|
+
* sudo gem install mihael-transender
|
44
|
+
|
45
|
+
RubyForge style:
|
46
|
+
|
47
|
+
* sudo gem install transender
|
48
|
+
|
49
|
+
== LICENSE:
|
50
|
+
|
51
|
+
(The MIT License)
|
52
|
+
|
53
|
+
Copyright (c) 2008 FIXME (different license?)
|
54
|
+
|
55
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
56
|
+
a copy of this software and associated documentation files (the
|
57
|
+
'Software'), to deal in the Software without restriction, including
|
58
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
59
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
60
|
+
permit persons to whom the Software is furnished to do so, subject to
|
61
|
+
the following conditions:
|
62
|
+
|
63
|
+
The above copyright notice and this permission notice shall be
|
64
|
+
included in all copies or substantial portions of the Software.
|
65
|
+
|
66
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
67
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
68
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
69
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
70
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
71
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
72
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
begin
|
4
|
+
require 'jeweler'
|
5
|
+
Jeweler::Tasks.new do |gem|
|
6
|
+
gem.name = "transender"
|
7
|
+
gem.summary = %Q{Use Transender whenever you need to git-clone and rename XCode iPhone SDK projects.}
|
8
|
+
gem.email = "kitschmaster@gmail.com"
|
9
|
+
gem.homepage = "http://github.com/mihael/transender"
|
10
|
+
gem.authors = ["Mihael"]
|
11
|
+
gem.rubyforge_project = "transender"
|
12
|
+
|
13
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
14
|
+
end
|
15
|
+
|
16
|
+
Jeweler::RubyforgeTasks.new
|
17
|
+
rescue LoadError
|
18
|
+
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
19
|
+
end
|
20
|
+
|
21
|
+
require 'spec/rake/spectask'
|
22
|
+
Spec::Rake::SpecTask.new(:spec) do |spec|
|
23
|
+
spec.libs << 'lib' << 'spec'
|
24
|
+
spec.spec_files = FileList['spec/**/*_spec.rb']
|
25
|
+
end
|
26
|
+
|
27
|
+
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
28
|
+
spec.libs << 'lib' << 'spec'
|
29
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
30
|
+
spec.rcov = true
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
task :default => :spec
|
35
|
+
|
36
|
+
require 'rake/rdoctask'
|
37
|
+
Rake::RDocTask.new do |rdoc|
|
38
|
+
if File.exist?('VERSION.yml')
|
39
|
+
config = YAML.load(File.read('VERSION.yml'))
|
40
|
+
version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
|
41
|
+
else
|
42
|
+
version = ""
|
43
|
+
end
|
44
|
+
|
45
|
+
rdoc.rdoc_dir = 'rdoc'
|
46
|
+
rdoc.title = "trans #{version}"
|
47
|
+
rdoc.rdoc_files.include('README*')
|
48
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
49
|
+
end
|
50
|
+
|
data/VERSION.yml
ADDED
data/bin/transender
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require File.expand_path(File.join(File.dirname(__FILE__), %w[.. lib transender]))
|
4
|
+
|
5
|
+
$:.unshift File.join(File.dirname(__FILE__))
|
6
|
+
|
7
|
+
#arguments
|
8
|
+
transform = ARGV[0]
|
9
|
+
app_title = ARGV[1]
|
10
|
+
out_dir = ARGV[2]
|
11
|
+
|
12
|
+
def usage
|
13
|
+
puts "Transender #{Transender::VERSION} - the iPhoneSDK cloning/renaming gem"
|
14
|
+
puts "Usage:\n"
|
15
|
+
puts "~>transender git://github.com/somebodyatgithub/someiphoneipodproject.git myCoolProject /myCool/Path/To/Projects/Path/"
|
16
|
+
puts "transform - a git repository \n"
|
17
|
+
puts "app_title - a fresh app / cloned from transform, renamed and replaced\n"
|
18
|
+
puts "out_dir - where to put fresh app's files\n"
|
19
|
+
end
|
20
|
+
|
21
|
+
unless transform&&app_title&&out_dir
|
22
|
+
usage
|
23
|
+
exit
|
24
|
+
end
|
25
|
+
|
26
|
+
require 'benchmark'
|
27
|
+
|
28
|
+
time = Benchmark.realtime {Transender::Ji.transform_and_zip({:transform => transform, :app_title => app_title, :ji_path => out_dir})}
|
29
|
+
puts "Realtime used : #{time}sec"
|
30
|
+
|
31
|
+
# EOF
|
data/lib/transender.rb
ADDED
@@ -0,0 +1,178 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require 'ftools'
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
module Transender
|
6
|
+
|
7
|
+
# :stopdoc:
|
8
|
+
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
|
9
|
+
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
|
10
|
+
V = YAML.load_file(File.join(File.dirname(__FILE__), %w[.. VERSION.yml]))
|
11
|
+
VERSION = "#{V[:major]}.#{V[:minor]}.#{V[:patch]}"
|
12
|
+
# :startdoc:
|
13
|
+
|
14
|
+
# Returns the version string for the library.
|
15
|
+
#
|
16
|
+
def self.version
|
17
|
+
VERSION
|
18
|
+
end
|
19
|
+
|
20
|
+
# Returns the library path for the module. If any arguments are given,
|
21
|
+
# they will be joined to the end of the libray path using
|
22
|
+
# <tt>File.join</tt>.
|
23
|
+
#
|
24
|
+
def self.libpath( *args )
|
25
|
+
args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Returns the lpath for the module. If any arguments are given,
|
29
|
+
# they will be joined to the end of the path using
|
30
|
+
# <tt>File.join</tt>.
|
31
|
+
#
|
32
|
+
def self.path( *args )
|
33
|
+
args.empty? ? PATH : ::File.join(PATH, args.flatten)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Utility method used to require all files ending in .rb that lie in the
|
37
|
+
# directory below this file that has the same name as the filename passed
|
38
|
+
# in. Optionally, a specific _directory_ name can be passed in such that
|
39
|
+
# the _filename_ does not have to be equivalent to the directory.
|
40
|
+
#
|
41
|
+
def self.require_all_libs_relative_to( fname, dir = nil )
|
42
|
+
dir ||= ::File.basename(fname, '.*')
|
43
|
+
search_me = ::File.expand_path(
|
44
|
+
::File.join(::File.dirname(fname), dir, '**', '*.rb'))
|
45
|
+
|
46
|
+
Dir.glob(search_me).sort.each {|rb| require rb}
|
47
|
+
end
|
48
|
+
|
49
|
+
#replaces all 'old' strings with 'fresh' strings
|
50
|
+
def self.replace_in_file( in_file, old, fresh, out_file)
|
51
|
+
`sed 's/#{old}/#{fresh}/g' <'#{in_file}' >'#{out_file}'`
|
52
|
+
end
|
53
|
+
|
54
|
+
def self.replace_strings_in_file(old, fresh, filename)
|
55
|
+
temp = "#{filename}.temp"
|
56
|
+
FileUtils.mv filename, temp
|
57
|
+
Transender.replace_in_file(temp, old, fresh, filename)
|
58
|
+
FileUtils.rm temp
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.zip_dir(dir, out_file)
|
62
|
+
`tar cvfz '#{out_file}' '#{dir}'`
|
63
|
+
out_file
|
64
|
+
end
|
65
|
+
|
66
|
+
def self.extract_app_title(giturl)
|
67
|
+
giturl.split('/').last.split('.').first
|
68
|
+
end
|
69
|
+
|
70
|
+
#Transender - Ji
|
71
|
+
class Ji
|
72
|
+
attr_accessor :options, :app_title, :app_path, :transform, :transform_title, :ji_path, :id
|
73
|
+
|
74
|
+
# Supply a Hash of options containing:
|
75
|
+
# options[:app_title]:: your fresh apps title
|
76
|
+
# options[:transform]:: git repository of the base project - app_title becomes a clone of it
|
77
|
+
# options[:ji_path]:: output dir
|
78
|
+
def initialize(options)
|
79
|
+
raise ArgumentError unless options.class == Hash && options[:app_title] && options[:transform] && options[:ji_path]
|
80
|
+
@options = options
|
81
|
+
@app_title = @options[:app_title]
|
82
|
+
@transform = @options[:transform]
|
83
|
+
@transform_title = Transender.extract_app_title(@transform)
|
84
|
+
@ji_path = @options[:ji_path]
|
85
|
+
@app_path = File.join(@ji_path, @app_title)
|
86
|
+
@id = Time.now.strftime("%Y-%m-%d-%s")
|
87
|
+
end
|
88
|
+
|
89
|
+
#clones from transform then removes git
|
90
|
+
def clone_and_remove_git
|
91
|
+
#prepare destination without any warning
|
92
|
+
`rm -rf #{@app_path}`
|
93
|
+
#clone that git repo and rename at the same time, use --work-tree, otherwise rake spec fails miserably
|
94
|
+
`git --work-tree=#{@app_path} clone --no-hardlinks #{@transform} #{@app_path}`
|
95
|
+
#remove any past life remains from the fresh project
|
96
|
+
`rm -rf #{File.join(@app_path, 'build')}`
|
97
|
+
`rm -rf #{File.join(@app_path, '.git')}`
|
98
|
+
puts "Cloned from #{@transform} into #{@app_path}."
|
99
|
+
end
|
100
|
+
|
101
|
+
#renames within project app_title
|
102
|
+
def rename
|
103
|
+
todo = ""
|
104
|
+
if rename_files
|
105
|
+
if replace_strings_in_files
|
106
|
+
else
|
107
|
+
todo << 'TODO: You need to replace some strings in some files manually. Thanks.\n'
|
108
|
+
end
|
109
|
+
else
|
110
|
+
todo << 'TODO: You need to rename some files manually. Thanks.\n'
|
111
|
+
end
|
112
|
+
todo = todo.empty? ? "Renamed/replaced occurences of #{transform_title} to #{app_title}." : todo
|
113
|
+
puts todo
|
114
|
+
end
|
115
|
+
|
116
|
+
def zip
|
117
|
+
z = File.join(ji_path, "#{app_title}.zip")
|
118
|
+
`rm -rf #{z}` #remove any previous zips without any warnings
|
119
|
+
`cd #{ji_path}; tar cvfz #{app_title}.zip #{app_title}/`
|
120
|
+
puts "Zipped #{app_title} into #{z}" if File.exists?(z)
|
121
|
+
z
|
122
|
+
end
|
123
|
+
|
124
|
+
def transformize
|
125
|
+
clone_and_remove_git
|
126
|
+
rename
|
127
|
+
zip
|
128
|
+
end
|
129
|
+
|
130
|
+
#Use maybe like this: Transender::Ji.transform_and_zip(ahash) {|zip| render :text => zip}
|
131
|
+
def self.transform_and_zip(t={}, &block)
|
132
|
+
zip = Ji.new(t).transformize
|
133
|
+
yield zip if block
|
134
|
+
end
|
135
|
+
|
136
|
+
private
|
137
|
+
|
138
|
+
def rename_files
|
139
|
+
FileUtils.mv "#{app_path}/#{transform_title}.xcodeproj", "#{app_path}/#{app_title}.xcodeproj"
|
140
|
+
Dir["#{app_path}/*.{m,h,pch}"].each do |filename|
|
141
|
+
if filename =~ /#{transform_title}/
|
142
|
+
FileUtils.mv filename, filename.gsub(/#{transform_title}/, app_title)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
Dir["#{app_path}/Classes/*.{m,h}"].each do |filename|
|
146
|
+
if filename =~ /#{transform_title}/
|
147
|
+
FileUtils.mv filename, filename.gsub(/#{transform_title}/, app_title)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
true
|
151
|
+
rescue
|
152
|
+
puts $!
|
153
|
+
false
|
154
|
+
end
|
155
|
+
|
156
|
+
def replace_strings_in_files
|
157
|
+
Dir["#{app_path}/*.{m,h,pch,xib}"].each do |filename|
|
158
|
+
Transender.replace_strings_in_file(transform_title, app_title, filename)
|
159
|
+
end
|
160
|
+
Dir["#{app_path}/Classes/*.{m,h}"].each do |filename|
|
161
|
+
Transender.replace_strings_in_file(transform_title, app_title, filename)
|
162
|
+
end
|
163
|
+
Dir["#{app_path}/#{app_title}.xcodeproj/*.*"].each do |filename|
|
164
|
+
Transender.replace_strings_in_file(transform_title, app_title, filename)
|
165
|
+
end
|
166
|
+
true
|
167
|
+
rescue
|
168
|
+
puts $!
|
169
|
+
false
|
170
|
+
end
|
171
|
+
|
172
|
+
end # class Ji
|
173
|
+
|
174
|
+
end # module Transender
|
175
|
+
|
176
|
+
Transender.require_all_libs_relative_to(__FILE__)
|
177
|
+
|
178
|
+
# EOF
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
require File.expand_path(
|
3
|
+
File.join(File.dirname(__FILE__), %w[.. lib transender]))
|
4
|
+
|
5
|
+
Spec::Runner.configure do |config|
|
6
|
+
# == Mock Framework
|
7
|
+
#
|
8
|
+
# RSpec uses it's own mocking framework by default. If you prefer to
|
9
|
+
# use mocha, flexmock or RR, uncomment the appropriate line:
|
10
|
+
#
|
11
|
+
# config.mock_with :mocha
|
12
|
+
# config.mock_with :flexmock
|
13
|
+
# config.mock_with :rr
|
14
|
+
end
|
15
|
+
|
16
|
+
# EOF
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), %w[spec_helper])
|
2
|
+
include Transender
|
3
|
+
|
4
|
+
describe Transender do
|
5
|
+
|
6
|
+
it "should not be instantiated without cool arguments" do
|
7
|
+
lambda { Ji.new( ) }.should raise_error
|
8
|
+
lambda { Ji.new( "not Hash" ) }.should raise_error(ArgumentError)
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should be instantiated with fine hashish" do
|
12
|
+
lambda { Ji.new( {:app_title=>"xyzproject", :transform=>"iproject", :ji_path=>""} ) }.should_not raise_error
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should clone and remove git" do
|
16
|
+
ji = Ji.new({:app_title=>"xyzproject", :transform=>File.join(File.dirname(__FILE__), %w[.. iproject]), :ji_path => File.join(File.dirname(__FILE__), %w[.. tmp]) })
|
17
|
+
ji.clone_and_remove_git
|
18
|
+
File.exists?(ji.app_path).should be(true)
|
19
|
+
File.exists?(File.join(ji.app_path, '.git')).should be(false)
|
20
|
+
File.exists?(File.join(ji.app_path, 'build')).should be(false)
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should clone and remove git and rename" do
|
24
|
+
ji = Ji.new({:app_title=>"xyzproject", :transform=>File.join(File.dirname(__FILE__), %w[.. iproject]), :ji_path => File.join(File.dirname(__FILE__), %w[.. tmp]) })
|
25
|
+
ji.clone_and_remove_git
|
26
|
+
ji.rename
|
27
|
+
puts File.exists?(File.join(ji.app_path)).should be(true)
|
28
|
+
end
|
29
|
+
|
30
|
+
|
31
|
+
it "should transform and zip" do
|
32
|
+
proc do
|
33
|
+
Ji.transform_and_zip({:app_title=>"xyzproject", :transform=>File.join(File.dirname(__FILE__), %w[.. iproject]), :ji_path => File.join(File.dirname(__FILE__), %w[.. tmp]) }) do |zip|
|
34
|
+
zip.should == File.join(File.dirname(__FILE__), %w[.. tmp xyzproject.zip])
|
35
|
+
File.exists?(zip).should == true
|
36
|
+
end
|
37
|
+
end.should_not raise_error
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should transform and zip a remote git project" do
|
41
|
+
proc do
|
42
|
+
Ji.transform_and_zip({:app_title=>"freshproject", :transform=>" git://github.com/mihael/iproject.git", :ji_path => File.join(File.dirname(__FILE__), %w[.. tmp]) }) do |zip|
|
43
|
+
zip.should == File.join(File.dirname(__FILE__), %w[.. tmp freshproject.zip])
|
44
|
+
File.exists?(zip).should == true
|
45
|
+
end
|
46
|
+
end.should_not raise_error
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require File.expand_path(File.join(File.dirname(__FILE__), %w[.. lib transender]))
|
3
|
+
|
4
|
+
puts "Testing with local transform repository...\n"
|
5
|
+
Transender::Ji.transform_and_zip({:app_title=>"myClonedProject", :transform=>File.join(File.dirname(__FILE__), %w[iproject]), :ji_path => File.join(File.dirname(__FILE__), %w[.. tmp]) }) do |zip|
|
6
|
+
puts "Transender::Ji.transform_and_zip finished with #{zip}."
|
7
|
+
end
|
8
|
+
|
9
|
+
puts "Testing with remote transform repository...\n"
|
10
|
+
Transender::Ji.transform_and_zip({:app_title=>"myRemotelyClonedProject", :transform=>"git://github.com/mihael/iproject.git", :ji_path => File.join(File.dirname(__FILE__), %w[.. tmp]) }) do |zip|
|
11
|
+
puts "Transender::Ji.transform_and_zip remote finished with #{zip}."
|
12
|
+
end
|
data/transender.gemspec
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{transender}
|
5
|
+
s.version = "0.2.4"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Mihael"]
|
9
|
+
s.date = %q{2009-07-06}
|
10
|
+
s.default_executable = %q{transender}
|
11
|
+
s.email = %q{kitschmaster@gmail.com}
|
12
|
+
s.executables = ["transender"]
|
13
|
+
s.extra_rdoc_files = [
|
14
|
+
"LICENSE",
|
15
|
+
"README.rdoc",
|
16
|
+
"README.txt"
|
17
|
+
]
|
18
|
+
s.files = [
|
19
|
+
".gitattributes",
|
20
|
+
".gitignore",
|
21
|
+
".gitmodules",
|
22
|
+
"History.txt",
|
23
|
+
"LICENSE",
|
24
|
+
"README.rdoc",
|
25
|
+
"README.txt",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION.yml",
|
28
|
+
"bin/transender",
|
29
|
+
"lib/tasks/pushup.rake",
|
30
|
+
"lib/transender.rb",
|
31
|
+
"spec/spec_helper.rb",
|
32
|
+
"spec/transender_spec.rb",
|
33
|
+
"test/test_transender.rb",
|
34
|
+
"test/test_transender.sh",
|
35
|
+
"transender.gemspec"
|
36
|
+
]
|
37
|
+
s.homepage = %q{http://github.com/mihael/transender}
|
38
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
39
|
+
s.require_paths = ["lib"]
|
40
|
+
s.rubyforge_project = %q{transender}
|
41
|
+
s.rubygems_version = %q{1.3.4}
|
42
|
+
s.summary = %q{Use Transender whenever you need to git-clone and rename XCode iPhone SDK projects.}
|
43
|
+
s.test_files = [
|
44
|
+
"spec/spec_helper.rb",
|
45
|
+
"spec/transender_spec.rb",
|
46
|
+
"test/test_transender.rb"
|
47
|
+
]
|
48
|
+
|
49
|
+
if s.respond_to? :specification_version then
|
50
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
51
|
+
s.specification_version = 3
|
52
|
+
|
53
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
54
|
+
else
|
55
|
+
end
|
56
|
+
else
|
57
|
+
end
|
58
|
+
end
|
metadata
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: transender
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Mihael
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-07-06 00:00:00 +02:00
|
13
|
+
default_executable: transender
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description:
|
17
|
+
email: kitschmaster@gmail.com
|
18
|
+
executables:
|
19
|
+
- transender
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- LICENSE
|
24
|
+
- README.rdoc
|
25
|
+
- README.txt
|
26
|
+
files:
|
27
|
+
- .gitattributes
|
28
|
+
- .gitignore
|
29
|
+
- .gitmodules
|
30
|
+
- History.txt
|
31
|
+
- LICENSE
|
32
|
+
- README.rdoc
|
33
|
+
- README.txt
|
34
|
+
- Rakefile
|
35
|
+
- VERSION.yml
|
36
|
+
- bin/transender
|
37
|
+
- lib/tasks/pushup.rake
|
38
|
+
- lib/transender.rb
|
39
|
+
- spec/spec_helper.rb
|
40
|
+
- spec/transender_spec.rb
|
41
|
+
- test/test_transender.rb
|
42
|
+
- test/test_transender.sh
|
43
|
+
- transender.gemspec
|
44
|
+
has_rdoc: true
|
45
|
+
homepage: http://github.com/mihael/transender
|
46
|
+
licenses: []
|
47
|
+
|
48
|
+
post_install_message:
|
49
|
+
rdoc_options:
|
50
|
+
- --charset=UTF-8
|
51
|
+
require_paths:
|
52
|
+
- lib
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: "0"
|
58
|
+
version:
|
59
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: "0"
|
64
|
+
version:
|
65
|
+
requirements: []
|
66
|
+
|
67
|
+
rubyforge_project: transender
|
68
|
+
rubygems_version: 1.3.4
|
69
|
+
signing_key:
|
70
|
+
specification_version: 3
|
71
|
+
summary: Use Transender whenever you need to git-clone and rename XCode iPhone SDK projects.
|
72
|
+
test_files:
|
73
|
+
- spec/spec_helper.rb
|
74
|
+
- spec/transender_spec.rb
|
75
|
+
- test/test_transender.rb
|