Skip to content

Commit

Permalink
renamed module namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
manifest committed Jun 14, 2012
1 parent d934067 commit 9bdf6c5
Show file tree
Hide file tree
Showing 29 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion lib/xcodeproject/build_phase_node.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'xcodeproject/node'
require 'xcodeproject/pbx_build_file'

module XCodeProject
module XcodeProject
class BuildPhaseNode < Node
def initialize (root, uuid, data)
super(root, uuid, data)
Expand Down
2 changes: 1 addition & 1 deletion lib/xcodeproject/data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

require 'xcodeproject/root_node'

module XCodeProject
module XcodeProject
class Data
def initialize (data, wd)
@root = RootNode.new(data, wd)
Expand Down
2 changes: 1 addition & 1 deletion lib/xcodeproject/exceptions.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module XCodeProject
module XcodeProject
class ParseError < StandardError; end
class FilePathError < StandardError; end
class GroupPathError < StandardError; end
Expand Down
2 changes: 1 addition & 1 deletion lib/xcodeproject/extend/array.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'xcodeproject/formatter'

class Array
def to_plist (fmtr = XCodeProject::Formatter.new)
def to_plist (fmtr = XcodeProject::Formatter.new)
items = map { |item| "#{item.to_plist(fmtr)}" }
%{(#{fmtr.t2}#{items.join(",#{fmtr.t2}")}#{fmtr.t1})}
end
Expand Down
2 changes: 1 addition & 1 deletion lib/xcodeproject/extend/hash.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'xcodeproject/formatter'

class Hash
def to_plist (fmtr = XCodeProject::Formatter.new)
def to_plist (fmtr = XcodeProject::Formatter.new)
fmtr.inc
items = map { |key, value| "#{key.to_plist(fmtr)} = #{value.to_plist(fmtr)};" }
fmtr.dec
Expand Down
2 changes: 1 addition & 1 deletion lib/xcodeproject/file_node.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'xcodeproject/node'
require 'pathname'

module XCodeProject
module XcodeProject
class FileNode < Node
attr_reader :name
attr_reader :path
Expand Down
2 changes: 1 addition & 1 deletion lib/xcodeproject/formatter.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module XCodeProject
module XcodeProject
class Formatter
def initialize
@counter = 0
Expand Down
2 changes: 1 addition & 1 deletion lib/xcodeproject/node.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module XCodeProject
module XcodeProject
class Node
attr_reader :uuid
attr_reader :isa
Expand Down
2 changes: 1 addition & 1 deletion lib/xcodeproject/pbx_build_file.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'xcodeproject/node'

module XCodeProject
module XcodeProject
class PBXBuildFile < Node
attr_reader :file_ref

Expand Down
2 changes: 1 addition & 1 deletion lib/xcodeproject/pbx_file_reference.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'xcodeproject/file_node'
require 'xcodeproject/exceptions'

module XCodeProject
module XcodeProject
class PBXFileReference < FileNode
def initialize (root, uuid, data)
super(root, uuid, data)
Expand Down
2 changes: 1 addition & 1 deletion lib/xcodeproject/pbx_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'xcodeproject/exceptions'
require 'pathname'

module XCodeProject
module XcodeProject
class PBXGroup < FileNode
def initialize (root, uuid, data)
super(root, uuid, data)
Expand Down
2 changes: 1 addition & 1 deletion lib/xcodeproject/pbx_native_target.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'xcodeproject/xc_configuration_list'
require 'xcodeproject/build_phase_node'

module XCodeProject
module XcodeProject
class PBXNativeTarget < Node
attr_reader :name
attr_reader :product_name
Expand Down
2 changes: 1 addition & 1 deletion lib/xcodeproject/pbx_project.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'xcodeproject/node'

module XCodeProject
module XcodeProject
class PBXProject < Node
attr_reader :main_group
attr_reader :product_ref_group
Expand Down
2 changes: 1 addition & 1 deletion lib/xcodeproject/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
require 'pathname'
require 'find'

module XCodeProject
module XcodeProject
class Project
attr_reader :bundle_path
attr_reader :file_path
Expand Down
4 changes: 2 additions & 2 deletions lib/xcodeproject/root_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
require 'xcodeproject/extend/array'
require 'xcodeproject/extend/hash'

module XCodeProject
module XcodeProject
class RootNode
def initialize (data, wd)
@data, @wd = data, Pathname.new(wd)
Expand All @@ -50,7 +50,7 @@ def build_files (file_ref_uuid)

def object (uuid)
data = @objects[uuid]
XCodeProject.const_get(data['isa']).new(self, uuid, data) unless data.nil?
XcodeProject.const_get(data['isa']).new(self, uuid, data) unless data.nil?
end

def object! (uuid)
Expand Down
10 changes: 5 additions & 5 deletions lib/xcodeproject/spec/build_phase_node_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "spec_helper"

describe XCodeProject::BuildPhaseNode do
describe XcodeProject::BuildPhaseNode do
let(:root) { prepare_example_project.read.send(:root) }
let(:file_ref) { root.project.main_group.file_ref('group1a/file2c.m') }
let(:build_file) { root.project.target('example').sources_build_phase.send(:build_file, file_ref.uuid) }
Expand All @@ -9,7 +9,7 @@
describe "#files" do
it "returns an array of files" do
obj.files.should be_an_instance_of(Array)
obj.files.each {|obj| obj.should be_an_instance_of(XCodeProject::PBXFileReference) }
obj.files.each {|obj| obj.should be_an_instance_of(XcodeProject::PBXFileReference) }
end
end

Expand Down Expand Up @@ -56,19 +56,19 @@
describe "#build_files" do
it "returns an array of files" do
obj.send(:build_files).should be_an_instance_of(Array)
obj.send(:build_files).each {|obj| obj.should be_an_instance_of(XCodeProject::PBXBuildFile) }
obj.send(:build_files).each {|obj| obj.should be_an_instance_of(XcodeProject::PBXBuildFile) }
end
end

describe "#build_file" do
it "returns the object" do
obj.send(:build_file, file_ref.uuid).should be_an_instance_of(XCodeProject::PBXBuildFile)
obj.send(:build_file, file_ref.uuid).should be_an_instance_of(XcodeProject::PBXBuildFile)
end
end

describe "#add_build_file" do
it "adds the build file, returns the object" do
obj.send(:add_build_file, file_ref.uuid).should be_an_instance_of(XCodeProject::PBXBuildFile)
obj.send(:add_build_file, file_ref.uuid).should be_an_instance_of(XcodeProject::PBXBuildFile)
end
end

Expand Down
14 changes: 7 additions & 7 deletions lib/xcodeproject/spec/file_node_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "spec_helper"

describe XCodeProject::FileNode do
describe XcodeProject::FileNode do
let(:data_name) { Hash['name', 'file.name'] }
let(:data_path) { Hash['path', 'path/to/file.name'] }
let(:data_path_name) { data_path.merge!(data_name) }
Expand All @@ -10,19 +10,19 @@
context "if the name is initialized " do
it "returns the name as is" do
[data_name, data_path_name].each do |data|
XCodeProject::FileNode.new(stub, stub, data).name.should eql(data['name'])
XcodeProject::FileNode.new(stub, stub, data).name.should eql(data['name'])
end
end
end
context "if the name isn't initialized" do
context "and the path is initialized " do
it "returns the name as basename of the path" do
XCodeProject::FileNode.new(stub, stub, data_path).name.should eql(File.basename(data_path['path']))
XcodeProject::FileNode.new(stub, stub, data_path).name.should eql(File.basename(data_path['path']))
end
end
context "and the path isn't initialized" do
it "returns nil" do
XCodeProject::FileNode.new(stub, stub, data_empty).name.should be_nil
XcodeProject::FileNode.new(stub, stub, data_empty).name.should be_nil
end
end
end
Expand All @@ -32,13 +32,13 @@
context "if the path is initialized " do
it "returns the path as is" do
[data_path, data_path_name].each do |data|
XCodeProject::FileNode.new(stub, stub, data_path).path.should eql(data['path'])
XcodeProject::FileNode.new(stub, stub, data_path).path.should eql(data['path'])
end
end
end
context "if the path isn't initialized" do
it "returns nil" do
XCodeProject::FileNode.new(stub, stub, data_empty).path.should be_nil
XcodeProject::FileNode.new(stub, stub, data_empty).path.should be_nil
end
end
end
Expand All @@ -58,7 +58,7 @@
context "if the object is nested file node" do
it "returns the parent object" do
file_nodes_gpaths do |gpath|
main_group.child(gpath).parent.should be_an_instance_of(XCodeProject::PBXGroup)
main_group.child(gpath).parent.should be_an_instance_of(XcodeProject::PBXGroup)
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/xcodeproject/spec/pbx_build_file_spec.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
require "spec_helper"

describe XCodeProject::PBXBuildFile do
describe XcodeProject::PBXBuildFile do
let(:root) { prepare_example_project.read.send(:root) }
let(:obj_file_ref) { root.project.main_group.file_ref("group1a/file2c.m") }
let(:obj) { root.project.target('example').sources_build_phase.send(:build_file, obj_file_ref.uuid) }

describe "#file_ref" do
it "returns the object" do
obj.file_ref.should be_an_instance_of(XCodeProject::PBXFileReference)
obj.file_ref.should be_an_instance_of(XcodeProject::PBXFileReference)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/xcodeproject/spec/pbx_file_reference_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "spec_helper"

describe XCodeProject::PBXFileReference do
describe XcodeProject::PBXFileReference do
let(:root) { prepare_example_project.read.send(:root) }
let(:obj_gpath) { "group1a/file2c.m" }
let(:obj) { root.project.main_group.file_ref(obj_gpath) }
Expand Down
22 changes: 11 additions & 11 deletions lib/xcodeproject/spec/pbx_group_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "spec_helper"

describe XCodeProject::PBXGroup do
describe XcodeProject::PBXGroup do
let(:root) { prepare_example_project.read.send(:root) }
let(:obj) { root.project.main_group.group('group1a') }

Expand Down Expand Up @@ -101,7 +101,7 @@
describe "#group" do
context "if the group exists" do
it "returns the object" do
obj.group('group2a').should be_an_instance_of(XCodeProject::PBXGroup)
obj.group('group2a').should be_an_instance_of(XcodeProject::PBXGroup)
end
end
context "if the group doesn't exist" do
Expand All @@ -114,7 +114,7 @@
describe "#file_ref" do
context "if the file reference exists" do
it "returns the object" do
obj.file_ref('file2c.m').should be_an_instance_of(XCodeProject::PBXFileReference)
obj.file_ref('file2c.m').should be_an_instance_of(XcodeProject::PBXFileReference)
end
end
context "if the file reference doesn't exist" do
Expand All @@ -127,12 +127,12 @@
describe "#add_file_ref" do
context "if passed the relative path" do
it "adds the file reference, returns the object" do
obj.send(:add_file_ref, 'dir1b/file2b.m').should be_an_instance_of(XCodeProject::PBXFileReference)
obj.send(:add_file_ref, 'dir1b/file2b.m').should be_an_instance_of(XcodeProject::PBXFileReference)
end
end
context "if passed the absolute path" do
it "adds the file reference, returns the object" do
obj.send(:add_file_ref, "#{example_project_dir}/dir1b/file2b.m").should be_an_instance_of(XCodeProject::PBXFileReference)
obj.send(:add_file_ref, "#{example_project_dir}/dir1b/file2b.m").should be_an_instance_of(XcodeProject::PBXFileReference)
end
end
context "if file reference already exists" do
Expand All @@ -143,23 +143,23 @@
end
context "if file doesn't exit" do
it "raise an exception " do
lambda { obj.send(:add_file_ref, "file2c_ghost.m") }.should raise_exception(XCodeProject::FilePathError)
lambda { obj.send(:add_file_ref, "file2c_ghost.m") }.should raise_exception(XcodeProject::FilePathError)
end
end
end

describe "#add_group" do
it "adds the group, returns the object" do
group_obj = obj.add_group("group2a_ghost")
group_obj.should be_an_instance_of(XCodeProject::PBXGroup)
group_obj.should be_an_instance_of(XcodeProject::PBXGroup)
group_obj.group?.should eql(true)
end
end

describe "#add_dir" do
it "adds the group, returns the object" do
group_obj = obj.add_dir("dir1c")
group_obj.should be_an_instance_of(XCodeProject::PBXGroup)
group_obj.should be_an_instance_of(XcodeProject::PBXGroup)
group_obj.dir?.should eql(true)
end
it "adds all dir's children" do
Expand All @@ -172,15 +172,15 @@
end
context "if dir doesn't exit" do
it "raise an exception " do
lambda { obj.add_dir("dir2c_ghost") }.should raise_exception(XCodeProject::FilePathError)
lambda { obj.add_dir("dir2c_ghost") }.should raise_exception(XcodeProject::FilePathError)
end
end
end

describe "#create_group" do
context "if passed a group name" do
it "creates and returns the group object" do
obj.create_group('group2a_ghost').should be_an_instance_of(XCodeProject::PBXGroup)
obj.create_group('group2a_ghost').should be_an_instance_of(XcodeProject::PBXGroup)
end
end
context "if passed a group path" do
Expand All @@ -190,7 +190,7 @@
'group2a_ghost/group3a_ghost',
'group2a_ghost/../create_group2a_ghost/./group3a_ghost'
].each do |gpath|
obj.create_group(gpath).should be_an_instance_of(XCodeProject::PBXGroup)
obj.create_group(gpath).should be_an_instance_of(XcodeProject::PBXGroup)
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/xcodeproject/spec/pbx_native_target_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "spec_helper"

describe XCodeProject::PBXNativeTarget do
describe XcodeProject::PBXNativeTarget do
before(:each) { @data = prepare_example_project.read }
let(:obj) { obj = @data.target('example') }

Expand Down Expand Up @@ -30,7 +30,7 @@

describe "#build_configurations_list" do
it "returns the build configuration list object" do
obj.build_configurations_list.should be_an_instance_of(XCodeProject::XCConfigurationList)
obj.build_configurations_list.should be_an_instance_of(XcodeProject::XCConfigurationList)
end
end

Expand Down
8 changes: 4 additions & 4 deletions lib/xcodeproject/spec/pbx_project_spec.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
require "spec_helper"

describe XCodeProject::PBXProject do
describe XcodeProject::PBXProject do
before(:each) { @data = prepare_example_project.read }
let(:obj) { @data.project }

describe "#targets" do
it "returns the array of target objects" do
targets = obj.targets
targets.should be_an_instance_of(Array)
targets.each {|obj| obj.should be_an_instance_of(XCodeProject::PBXNativeTarget) }
targets.each {|obj| obj.should be_an_instance_of(XcodeProject::PBXNativeTarget) }
end
end

describe "#target" do
context "if the target exists" do
it "returns the object" do
obj.target('example').should be_an_instance_of(XCodeProject::PBXNativeTarget)
obj.target('example').should be_an_instance_of(XcodeProject::PBXNativeTarget)
end
end
context "if the target doesn't exist" do
Expand All @@ -27,7 +27,7 @@

describe "#main_group" do
it "returns the main group object" do
obj.main_group.should be_an_instance_of(XCodeProject::PBXGroup)
obj.main_group.should be_an_instance_of(XcodeProject::PBXGroup)
end
end
end
Expand Down
Loading

0 comments on commit 9bdf6c5

Please sign in to comment.