xcode-yamlizer 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +19 -0
- data/Gemfile +5 -0
- data/LICENSE.txt +22 -0
- data/README.md +61 -0
- data/Rakefile +1 -0
- data/bin/xcode-yamlize +20 -0
- data/bin/xcode-yamlizer +37 -0
- data/lib/xcode-yamlizer.rb +195 -0
- data/lib/xcode-yamlizer/cli.rb +48 -0
- data/lib/xcode-yamlizer/dumpers.rb +67 -0
- data/lib/xcode-yamlizer/version.rb +3 -0
- data/templates/post-merge-hook +18 -0
- data/templates/pre-commit-hook +18 -0
- data/xcode-yamlizer.gemspec +25 -0
- metadata +180 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Sergey Klimov
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
# XcodeYamlizer
|
2
|
+
|
3
|
+
[XCode's](http://stackoverflow.com/questions/2004135/how-to-merge-conflicts-file-project-pbxproj-in-xcode-use-svn)
|
4
|
+
[formats](http://stackoverflow.com/questions/4022362/merging-xcode-project-files)
|
5
|
+
[are](https://discussions.apple.com/thread/3081125?start=0&tstart=0)
|
6
|
+
[shitty](http://stackoverflow.com/questions/10552082/finding-the-error-in-xcodes-project-pbxproj-after-merge)
|
7
|
+
They are pain to merge and are impossible to read. YAML is pretty.
|
8
|
+
|
9
|
+
Imagine a brave new world with XCode's `nib`s, model files, storyboards,
|
10
|
+
project files - all in YAML. Thats what that project do!
|
11
|
+
|
12
|
+
You can see how pretty it looks on Github in this sample repo.
|
13
|
+
|
14
|
+
|
15
|
+
## Installation
|
16
|
+
|
17
|
+
Install XcodeYamlizer with:
|
18
|
+
|
19
|
+
$ gem install xcode-yamlizer
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
### Git hooks
|
24
|
+
|
25
|
+
The best and recommended way is to install `pre-commit` and `post-merge` hook.
|
26
|
+
You can do that from your project's working directory:
|
27
|
+
|
28
|
+
$ xcode-yamlize install
|
29
|
+
|
30
|
+
Then, before commit, `pre-commit` hook will:
|
31
|
+
|
32
|
+
# find all obscure `.xib`s, `.xcdatamodel`s, project files, etc.
|
33
|
+
# create appropriate YAML files with the same name + `.yaml` extension
|
34
|
+
# add them to commit (if necessary)
|
35
|
+
# add all obscure files to `.gitignore` (if necessary)
|
36
|
+
# remove all obscure files from git (if necessary) (but will leave them be in file system)
|
37
|
+
|
38
|
+
After merge, `post-merge` hook will:
|
39
|
+
|
40
|
+
# copy all obscure files to the same name + `~` postfix
|
41
|
+
# overrite all obscure files from the version controlled `yaml`es.
|
42
|
+
|
43
|
+
### Standalone
|
44
|
+
|
45
|
+
```
|
46
|
+
$ xcode-yamlizer
|
47
|
+
options:
|
48
|
+
-input (-i) convert file (autodetects direction)
|
49
|
+
-dir (-d) convert directory (default direction - from XCode to YAML)
|
50
|
+
-to_xcode direction: from YAML to XCode format
|
51
|
+
-verbose verbose mode
|
52
|
+
-help (-h) show help
|
53
|
+
```
|
54
|
+
|
55
|
+
## Contributing
|
56
|
+
|
57
|
+
1. Fork it
|
58
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
59
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
60
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
61
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/xcode-yamlize
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'xcode-yamlizer/cli'
|
4
|
+
|
5
|
+
|
6
|
+
if ARGV[0] != "install"
|
7
|
+
puts "Usage: xcode-yamlize install"
|
8
|
+
exit(1)
|
9
|
+
end
|
10
|
+
|
11
|
+
if !File.exists?(".git")
|
12
|
+
puts "No .git directory found."
|
13
|
+
exit(1)
|
14
|
+
end
|
15
|
+
|
16
|
+
cli = XcodeYamlizer::Cli.new
|
17
|
+
installed_hooks = cli.install_all
|
18
|
+
|
19
|
+
puts "Installed hooks: #{installed_hooks}"
|
20
|
+
puts
|
data/bin/xcode-yamlizer
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require 'xcode-yamlizer/version'
|
3
|
+
|
4
|
+
$KCODE = 'UTF8' unless RUBY_VERSION >= '1.9'
|
5
|
+
require 'args_parser'
|
6
|
+
require 'xcode-yamlizer'
|
7
|
+
|
8
|
+
puts XcodeYamlizer.public_instance_methods
|
9
|
+
|
10
|
+
parser = ArgsParser.parse ARGV do
|
11
|
+
arg :input, 'convert file (autodetects direction)', :alias => :i
|
12
|
+
arg :dir, 'convert directory (default direction - from XCode to YAML)', :alias => :d
|
13
|
+
arg :to_xcode, 'direction: from YAML to XCode format'
|
14
|
+
arg :verbose, 'verbose mode'
|
15
|
+
arg :help, 'show help', :alias => :h
|
16
|
+
validate :input, "invalid file" do |v|
|
17
|
+
File.exist?(v)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
if parser.has_option? :help \
|
22
|
+
or (!parser.has_param?(:input) and !parser.has_param? :dir) \
|
23
|
+
or (parser.has_param?(:input) and parser.has_param?(:dir))
|
24
|
+
STDERR.puts parser.help
|
25
|
+
exit 1
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
if parser.has_param? :input
|
32
|
+
XcodeYamlizer::convert_file parser[:input]
|
33
|
+
end
|
34
|
+
|
35
|
+
if parser.has_param? :dir
|
36
|
+
XcodeYamlizer::convert_directory parser[:dir], parser.has_option?(:to_xcode)
|
37
|
+
end
|
@@ -0,0 +1,195 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require 'xcode-yamlizer/version'
|
3
|
+
require 'xcode-yamlizer/dumpers'
|
4
|
+
require 'rugged'
|
5
|
+
require 'pathname'
|
6
|
+
|
7
|
+
|
8
|
+
$KCODE = 'UTF8' unless RUBY_VERSION >= '1.9'
|
9
|
+
require 'pp'
|
10
|
+
|
11
|
+
|
12
|
+
YAML_FORMATS = [".yaml", ".yml"]
|
13
|
+
PLIST_FORMATS = [".pbxproj"]
|
14
|
+
XML_FORMATS = [".xib", ".storyboard", /(.*).xcdatamodeld\/(.*).xcdatamodel\/contents/]
|
15
|
+
|
16
|
+
|
17
|
+
XCODE_FORMATS = PLIST_FORMATS + XML_FORMATS
|
18
|
+
|
19
|
+
|
20
|
+
DUMPERS = [
|
21
|
+
[YAML_FORMATS, YamlDumper],
|
22
|
+
[PLIST_FORMATS, PlistDumper],
|
23
|
+
[XML_FORMATS, XmlDumper],
|
24
|
+
]
|
25
|
+
|
26
|
+
|
27
|
+
module Enumerable
|
28
|
+
def include_filename?(filename)
|
29
|
+
self.each do |elem|
|
30
|
+
if elem.kind_of? Regexp and filename =~ elem
|
31
|
+
return true
|
32
|
+
end
|
33
|
+
end
|
34
|
+
return self.include? File.extname(filename)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def dumper_for_filename(filename)
|
39
|
+
DUMPERS.each do |formats, dumper|
|
40
|
+
if formats.include_filename? filename
|
41
|
+
return dumper.new(filename)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
return nil
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
def dump(output, object)
|
49
|
+
dumper = dumper_for_filename(output)
|
50
|
+
if dumper
|
51
|
+
dumper.dump(object)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
def load(input)
|
55
|
+
dumper = dumper_for_filename(input)
|
56
|
+
if dumper
|
57
|
+
return dumper.load()
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
def repo_add_files(files)
|
64
|
+
repo_dir = '.'
|
65
|
+
repo = Rugged::Repository.new(repo_dir)
|
66
|
+
index = repo.index
|
67
|
+
files.each do |file|
|
68
|
+
if not index.get_entry(file)
|
69
|
+
#puts "Adding: #{file}"
|
70
|
+
index.add(file)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
index.write()
|
74
|
+
end
|
75
|
+
|
76
|
+
def repo_remove_files(files)
|
77
|
+
repo_dir = '.'
|
78
|
+
repo = Rugged::Repository.new(repo_dir)
|
79
|
+
index = repo.index
|
80
|
+
files.each do |file|
|
81
|
+
if index.get_entry(file)
|
82
|
+
#puts "Removing: #{file}"
|
83
|
+
index.remove(file)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
index.write()
|
87
|
+
end
|
88
|
+
|
89
|
+
def repo_gitignore_add_files(files)
|
90
|
+
begin
|
91
|
+
already_ignored = IO.foreach(".gitignore").map do |line|
|
92
|
+
line.chomp
|
93
|
+
end
|
94
|
+
rescue Errno::ENOENT
|
95
|
+
already_ignored = []
|
96
|
+
end
|
97
|
+
|
98
|
+
|
99
|
+
new_ignored = files - already_ignored
|
100
|
+
|
101
|
+
if new_ignored.count > 0
|
102
|
+
File.open(".gitignore", "a") do |f|
|
103
|
+
f.puts "# XcodeYamlizer"
|
104
|
+
new_ignored.each do |line|
|
105
|
+
f.puts line
|
106
|
+
end
|
107
|
+
f.puts "# end"
|
108
|
+
end
|
109
|
+
|
110
|
+
puts "added to .gitignore:"
|
111
|
+
puts new_ignored
|
112
|
+
|
113
|
+
end
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
end
|
118
|
+
|
119
|
+
def chroot_to_repo
|
120
|
+
root = File.expand_path("..",Rugged::Repository.discover(Dir.pwd))
|
121
|
+
Dir.chdir(root)
|
122
|
+
end
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
module XcodeYamlizer
|
127
|
+
def self.convert_directory(dir, to_xcode)
|
128
|
+
puts "Conventering directory '#{dir}'..."
|
129
|
+
files = []
|
130
|
+
formats = to_xcode ? YAML_FORMATS : XCODE_FORMATS
|
131
|
+
|
132
|
+
Dir.glob(dir+"**/*").each do |filename|
|
133
|
+
if formats.include_filename? filename
|
134
|
+
files += [filename]
|
135
|
+
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
puts "Found:"
|
140
|
+
puts files
|
141
|
+
new_files = files.map do |file|
|
142
|
+
convert_file file
|
143
|
+
end
|
144
|
+
puts "Finished!"
|
145
|
+
return files, new_files
|
146
|
+
end
|
147
|
+
|
148
|
+
def self.convert_file(input)
|
149
|
+
result = nil
|
150
|
+
if YAML_FORMATS.include_filename? input
|
151
|
+
output = input.chomp(File.extname(input))
|
152
|
+
elsif XCODE_FORMATS.include_filename? input
|
153
|
+
output = "#{input}.yaml"
|
154
|
+
|
155
|
+
end
|
156
|
+
result = load(input)
|
157
|
+
dump(output, result)
|
158
|
+
if result
|
159
|
+
puts "#{input} => #{output}"
|
160
|
+
return output
|
161
|
+
else
|
162
|
+
puts "Don't know what to do with '#{input}'"
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
def self.root
|
167
|
+
return File.expand_path('../..', __FILE__)
|
168
|
+
end
|
169
|
+
|
170
|
+
def self.make_filepaths_non_relative files
|
171
|
+
files.map do |file|
|
172
|
+
file.sub(/^\.\//,"")
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
def self.run_pre_commit
|
177
|
+
chroot_to_repo()
|
178
|
+
files_remove, files_add = convert_directory('./', false)
|
179
|
+
files_remove = make_filepaths_non_relative files_remove
|
180
|
+
files_add = make_filepaths_non_relative files_add
|
181
|
+
repo_add_files files_add
|
182
|
+
|
183
|
+
repo_remove_files files_remove
|
184
|
+
repo_gitignore_add_files files_remove
|
185
|
+
end
|
186
|
+
|
187
|
+
def self.run_post_merge
|
188
|
+
chroot_to_repo()
|
189
|
+
convert_directory('./', true)
|
190
|
+
end
|
191
|
+
|
192
|
+
|
193
|
+
end
|
194
|
+
|
195
|
+
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require 'xcode-yamlizer'
|
3
|
+
module XcodeYamlizer
|
4
|
+
class Cli
|
5
|
+
|
6
|
+
HOOK_PATHS = {
|
7
|
+
"pre-commit-hook" =>'.git/hooks/pre-commit',
|
8
|
+
"post-merge-hook" =>'.git/hooks/post-merge-hook',
|
9
|
+
}
|
10
|
+
def answered_yes?(answer)
|
11
|
+
answer =~ /y\n/i || answer == "\n"
|
12
|
+
end
|
13
|
+
|
14
|
+
def install_all
|
15
|
+
HOOK_PATHS.each_key do |key|
|
16
|
+
install key
|
17
|
+
end
|
18
|
+
end
|
19
|
+
def install(hook_name)
|
20
|
+
if File.exists?(HOOK_PATHS[hook_name])
|
21
|
+
ask_to_overwrite hook_name
|
22
|
+
end
|
23
|
+
|
24
|
+
install_hook hook_name
|
25
|
+
end
|
26
|
+
|
27
|
+
def ask_to_overwrite(hook_name)
|
28
|
+
puts "xcode-yamlizer: WARNING There is already a #{hook_name} installed in this git repo."
|
29
|
+
print "Would you like to overwrite it? [Yn] "
|
30
|
+
answer = $stdin.gets
|
31
|
+
|
32
|
+
if answered_yes?(answer)
|
33
|
+
FileUtils.rm(HOOK_PATHS[hook_name])
|
34
|
+
else
|
35
|
+
puts "Not overwriting existing hook: #{HOOK_PATHS[hook_name]}"
|
36
|
+
puts
|
37
|
+
exit(1)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def install_hook (hook_name)
|
42
|
+
hook = File.join(XcodeYamlizer.root, 'templates', hook_name)
|
43
|
+
FileUtils.cp(hook, HOOK_PATHS[hook_name])
|
44
|
+
FileUtils.chmod(0755, HOOK_PATHS[hook_name])
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
require 'osx/plist'
|
2
|
+
require 'cobravsmongoose'
|
3
|
+
require 'ya2yaml'
|
4
|
+
require 'json'
|
5
|
+
require 'yaml'
|
6
|
+
|
7
|
+
class Dumper
|
8
|
+
def initialize(filename)
|
9
|
+
@filename = filename
|
10
|
+
end
|
11
|
+
|
12
|
+
def dump(object)
|
13
|
+
end
|
14
|
+
def load()
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
class PlistDumper < Dumper
|
19
|
+
def dump(object)
|
20
|
+
OSX::PropertyList.dump_file(@filename, object, :xml1)
|
21
|
+
end
|
22
|
+
def load()
|
23
|
+
return OSX::PropertyList.load_file(@filename)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
class YamlDumper < Dumper
|
28
|
+
def dump(object)
|
29
|
+
result = YAML::dump(object)
|
30
|
+
if result
|
31
|
+
File.open(@filename, 'w') do |f|
|
32
|
+
f.write(result)
|
33
|
+
#f.write(object.ya2yaml(:syck_compatible => false))
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def _hash_clean(obj)
|
39
|
+
if obj.respond_to?(:key?) && obj.key?(nil)
|
40
|
+
obj.delete(nil)
|
41
|
+
end
|
42
|
+
if obj.respond_to?(:each)
|
43
|
+
obj.find{ |*a| _hash_clean(a.last) }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
def load()
|
47
|
+
result = YAML::load_file(@filename)
|
48
|
+
_hash_clean(result)
|
49
|
+
return result
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
class XmlDumper < Dumper
|
54
|
+
def dump(object)
|
55
|
+
result = CobraVsMongoose.hash_to_xml(object)
|
56
|
+
if result
|
57
|
+
File.open(@filename, 'w') do |f|
|
58
|
+
f.write result
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
def load()
|
63
|
+
return CobraVsMongoose.xml_to_hash(IO.read(@filename))
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
if system("which rvm > /dev/null")
|
4
|
+
cmd = "rvm default do ruby -rrubygems "
|
5
|
+
elsif system("which rbenv > /dev/null")
|
6
|
+
cmd = "rbenv exec ruby -rrubygems "
|
7
|
+
else
|
8
|
+
cmd = "ruby -rrubygems "
|
9
|
+
end
|
10
|
+
|
11
|
+
if !system("#{cmd} -rxcode-yamlizer -e '' 2> /dev/null")
|
12
|
+
$stderr.puts "xcode-yamlizer: WARNING: Skipping checks because xcode-yamlizer the gem is not installed. (Did you change your Ruby version?)"
|
13
|
+
exit(0)
|
14
|
+
end
|
15
|
+
|
16
|
+
cmd << %Q{-e "require 'xcode-yamlizer'; XcodeYamlizer.run_post_merge"}
|
17
|
+
|
18
|
+
exit(system(cmd) ? 0 : 1)
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
if system("which rvm > /dev/null")
|
4
|
+
cmd = "rvm default do ruby -rrubygems "
|
5
|
+
elsif system("which rbenv > /dev/null")
|
6
|
+
cmd = "rbenv exec ruby -rrubygems "
|
7
|
+
else
|
8
|
+
cmd = "ruby -rrubygems "
|
9
|
+
end
|
10
|
+
|
11
|
+
if !system("#{cmd} -rxcode-yamlizer -e '' 2> /dev/null")
|
12
|
+
$stderr.puts "xcode-yamlizer: WARNING: Skipping checks because xcode-yamlizer the gem is not installed. (Did you change your Ruby version?)"
|
13
|
+
exit(0)
|
14
|
+
end
|
15
|
+
|
16
|
+
cmd << %Q{-e "require 'xcode-yamlizer'; XcodeYamlizer.run_pre_commit"}
|
17
|
+
|
18
|
+
exit(system(cmd) ? 0 : 1)
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'xcode-yamlizer/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "xcode-yamlizer"
|
8
|
+
gem.version = XcodeYamlizer::VERSION
|
9
|
+
gem.authors = ["Sergey Klimov"]
|
10
|
+
gem.email = ["sergey.v.klimov@gmail.com"]
|
11
|
+
gem.description = IO.read("README.md")
|
12
|
+
gem.summary = %q{Set of git hooks to store YAML files instead of Xcode projects and nibs in repo}
|
13
|
+
gem.homepage = "https://github.com/darvin/xcode-yamlizer"
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
gem.add_runtime_dependency "args_parser"
|
20
|
+
gem.add_runtime_dependency 'kballard-osx-plist'
|
21
|
+
gem.add_runtime_dependency 'cobravsmongoose'
|
22
|
+
gem.add_runtime_dependency 'ya2yaml'
|
23
|
+
gem.add_runtime_dependency 'json'
|
24
|
+
gem.add_runtime_dependency 'rugged'
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,180 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: xcode-yamlizer
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Sergey Klimov
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-01-06 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: args_parser
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: kballard-osx-plist
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: cobravsmongoose
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: ya2yaml
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: json
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :runtime
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: rugged
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :runtime
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
description: ! "# XcodeYamlizer\n\n[XCode's](http://stackoverflow.com/questions/2004135/how-to-merge-conflicts-file-project-pbxproj-in-xcode-use-svn)
|
111
|
+
\n[formats](http://stackoverflow.com/questions/4022362/merging-xcode-project-files)\n[are](https://discussions.apple.com/thread/3081125?start=0&tstart=0)
|
112
|
+
\n[shitty](http://stackoverflow.com/questions/10552082/finding-the-error-in-xcodes-project-pbxproj-after-merge)
|
113
|
+
\nThey are pain to merge and are impossible to read. YAML is pretty.\n\nImagine
|
114
|
+
a brave new world with XCode's `nib`s, model files, storyboards,\nproject files
|
115
|
+
- all in YAML. Thats what that project do!\n\nYou can see how pretty it looks on
|
116
|
+
Github in this sample repo.\n\n\n## Installation\n\nInstall XcodeYamlizer with:\n\n
|
117
|
+
\ $ gem install xcode-yamlizer\n\n## Usage\n\n### Git hooks\n\nThe best and recommended
|
118
|
+
way is to install `pre-commit` and `post-merge` hook.\nYou can do that from your
|
119
|
+
project's working directory:\n\n $ xcode-yamlize install\n\nThen, before commit,
|
120
|
+
`pre-commit` hook will:\n\n # find all obscure `.xib`s, `.xcdatamodel`s, project
|
121
|
+
files, etc.\n # create appropriate YAML files with the same name + `.yaml` extension\n
|
122
|
+
\ # add them to commit (if necessary)\n # add all obscure files to `.gitignore`
|
123
|
+
(if necessary)\n # remove all obscure files from git (if necessary) (but will
|
124
|
+
leave them be in file system)\n\nAfter merge, `post-merge` hook will:\n\n # copy
|
125
|
+
all obscure files to the same name + `~` postfix\n # overrite all obscure files
|
126
|
+
from the version controlled `yaml`es.\n\n### Standalone\n\n```\n$ xcode-yamlizer\noptions:\n
|
127
|
+
-input (-i) convert file (autodetects direction)\n -dir (-d) convert directory
|
128
|
+
(default direction - from XCode to YAML)\n -to_xcode direction: from YAML to
|
129
|
+
XCode format\n -verbose verbose mode\n -help (-h) show help\n```\n\n## Contributing\n\n1.
|
130
|
+
Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit
|
131
|
+
your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git
|
132
|
+
push origin my-new-feature`)\n5. Create new Pull Request\n"
|
133
|
+
email:
|
134
|
+
- sergey.v.klimov@gmail.com
|
135
|
+
executables:
|
136
|
+
- xcode-yamlize
|
137
|
+
- xcode-yamlizer
|
138
|
+
extensions: []
|
139
|
+
extra_rdoc_files: []
|
140
|
+
files:
|
141
|
+
- .gitignore
|
142
|
+
- Gemfile
|
143
|
+
- LICENSE.txt
|
144
|
+
- README.md
|
145
|
+
- Rakefile
|
146
|
+
- bin/xcode-yamlize
|
147
|
+
- bin/xcode-yamlizer
|
148
|
+
- lib/xcode-yamlizer.rb
|
149
|
+
- lib/xcode-yamlizer/cli.rb
|
150
|
+
- lib/xcode-yamlizer/dumpers.rb
|
151
|
+
- lib/xcode-yamlizer/version.rb
|
152
|
+
- templates/post-merge-hook
|
153
|
+
- templates/pre-commit-hook
|
154
|
+
- xcode-yamlizer.gemspec
|
155
|
+
homepage: https://github.com/darvin/xcode-yamlizer
|
156
|
+
licenses: []
|
157
|
+
post_install_message:
|
158
|
+
rdoc_options: []
|
159
|
+
require_paths:
|
160
|
+
- lib
|
161
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
162
|
+
none: false
|
163
|
+
requirements:
|
164
|
+
- - ! '>='
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
168
|
+
none: false
|
169
|
+
requirements:
|
170
|
+
- - ! '>='
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: '0'
|
173
|
+
requirements: []
|
174
|
+
rubyforge_project:
|
175
|
+
rubygems_version: 1.8.23
|
176
|
+
signing_key:
|
177
|
+
specification_version: 3
|
178
|
+
summary: Set of git hooks to store YAML files instead of Xcode projects and nibs in
|
179
|
+
repo
|
180
|
+
test_files: []
|