Skip to content
This repository has been archived by the owner on Jul 2, 2018. It is now read-only.

Commit

Permalink
Rename to CocoaSeeds
Browse files Browse the repository at this point in the history
  • Loading branch information
devxoul committed May 6, 2015
1 parent 358d5bd commit fe71d15
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 16 deletions.
3 changes: 3 additions & 0 deletions bin/seed
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env ruby

require 'cocoaseeds'
15 changes: 15 additions & 0 deletions cocoaseeds.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require 'date'

Gem::Specification.new do |s|
s.name = 'cocoaseeds'
s.version = '0.0.1'
s.date = Date.today
s.summary = "Git Submodule Alternative for Cocoa."
s.description = "Git Submodule Alternative for Cocoa."
s.authors = ["Suyeol Jeon"]
s.email = '[email protected]'
s.files = ["lib/cocoaseeds.rb"]
s.homepage = 'https://github.com/devxoul/CocoaSeeds'
s.license = 'MIT'
s.executables << 'seed'
end
30 changes: 14 additions & 16 deletions cocoamods.rb → lib/cocoaseeds.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env ruby

require 'Xcodeproj'


Expand All @@ -21,7 +19,7 @@ def github(repo, branch, options=nil)

url = 'https://github.com/' + repo
name = repo.split('/')[1]
dir = "Mods/#{name}"
dir = "Seeds/#{name}"

`test -d #{dir} && rm -rf #{dir}; git clone #{url} -b #{branch} #{dir} 2>&1`

Expand All @@ -41,19 +39,19 @@ def github(repo, branch, options=nil)
end


def read_modfile
def read_seedfile
begin
return File.read('Modfile')
return File.read('Seedfile')
rescue
puts 'No Modfile.'
puts 'No Seedfile.'
exit 1
end
end


def install
mods = read_modfile.split('\r\n')
mods.each do |line|
seeds = read_seedfile.split('\r\n')
seeds.each do |line|
eval line
end
generate_project
Expand All @@ -72,19 +70,19 @@ def generate_project

puts "Configuring #{project_filename}"

group_mods = project['Mods']
if not group_mods.nil?
group_mods.clear
group_seeds = project['Seeds']
if not group_seeds.nil?
group_seeds.clear
else
group_mods = project.new_group('Mods')
group_seeds = project.new_group('Seeds')
end

file_references = []

$source_files.each do |mod, files|
group_mod = group_mods.new_group(mod)
$source_files.each do |seed, files|
group_seed = group_seeds.new_group(seed)
files.each do |file|
added_file = group_mod.new_file(file)
added_file = group_seed.new_file(file)
file_references.push(added_file)
end
end
Expand Down Expand Up @@ -124,5 +122,5 @@ def generate_project
when 'install'
install
else
puts 'Usage: cocoamods install'
puts 'Usage: seed install'
end

0 comments on commit fe71d15

Please sign in to comment.