Class: Pod::Spec

Inherits:
Object
  • Object
show all
Defined in:
lib/swiftproj/pod.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ Spec

Returns a new instance of Spec.

Yields:

  • (_self)

Yield Parameters:

  • _self (Pod::Spec)

    the object that the method was called on



17
18
19
20
21
22
23
# File 'lib/swiftproj/pod.rb', line 17

def initialize()
  @ios = OS.new
  @osx = OS.new
  @tvos = OS.new
  @watchos = OS.new
  yield self if block_given?
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object



25
26
27
# File 'lib/swiftproj/pod.rb', line 25

def method_missing(*args)
  # do nothing
end

Instance Attribute Details

#iosObject

Returns the value of attribute ios.



4
5
6
# File 'lib/swiftproj/pod.rb', line 4

def ios
  @ios
end

#osxObject

Returns the value of attribute osx.



5
6
7
# File 'lib/swiftproj/pod.rb', line 5

def osx
  @osx
end

#tvosObject

Returns the value of attribute tvos.



6
7
8
# File 'lib/swiftproj/pod.rb', line 6

def tvos
  @tvos
end

#versionObject

Returns the value of attribute version.



3
4
5
# File 'lib/swiftproj/pod.rb', line 3

def version
  @version
end

#watchosObject

Returns the value of attribute watchos.



7
8
9
# File 'lib/swiftproj/pod.rb', line 7

def watchos
  @watchos
end

Class Method Details

.from_podspec(content) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/swiftproj/pod.rb', line 9

def self.from_podspec(content)
  pod = eval(content)
  if pod.version.nil?
    raise Swiftproj::MissingPodspecVersionError.new
  end
  return pod
end

Instance Method Details

#==(spec) ⇒ Object



29
30
31
32
33
34
35
36
37
# File 'lib/swiftproj/pod.rb', line 29

def ==(spec)
  return false unless self.class == spec.class
  return false unless self.version == spec.version
  return false unless self.ios == spec.ios
  return false unless self.osx == spec.osx
  return false unless self.tvos == spec.tvos
  return false unless self.watchos == spec.watchos
  return true
end