Class: Pod::BasicInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-vemars/command/basicInfo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app_key, bundle_id = nil, name = nil, version = nil) ⇒ BasicInfo

Returns a new instance of BasicInfo.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/cocoapods-vemars/command/basicInfo.rb', line 9

def initialize(app_key, bundle_id=nil, name=nil, version=nil)
  @app_key = app_key
  @name = name
  @bundle_id = bundle_id
  @version = version

  prefix = name[0..2].upcase
  @string_replacements = {
    "Bob" => "ByteDance",
    "TODAYS_DATE" => date,
    "TODAYS_YEAR" => year,
    "${USER_NAME}" => user_name,
    "${USER_EMAIL}" => user_email,
    "${YEAR}" => year,
    "${DATE}" => date,

    "Template" => @name,
    "Template_InHouse" => @name + "_InHouse",
    "${POD_NAME}" => @name,
    "CPD" => prefix,
    "${APPKEY}" => @app_key,
    "${MPAAS_VERSION}" => @version,
    "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}" => @bundle_id
  }
end

Instance Attribute Details

#app_keyObject (readonly)

Returns the value of attribute app_key.



3
4
5
# File 'lib/cocoapods-vemars/command/basicInfo.rb', line 3

def app_key
  @app_key
end

#bundle_idObject (readonly)

Returns the value of attribute bundle_id.



5
6
7
# File 'lib/cocoapods-vemars/command/basicInfo.rb', line 5

def bundle_id
  @bundle_id
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/cocoapods-vemars/command/basicInfo.rb', line 4

def name
  @name
end

#string_replacementsObject (readonly)

Returns the value of attribute string_replacements.



7
8
9
# File 'lib/cocoapods-vemars/command/basicInfo.rb', line 7

def string_replacements
  @string_replacements
end

#versionObject (readonly)

Returns the value of attribute version.



6
7
8
# File 'lib/cocoapods-vemars/command/basicInfo.rb', line 6

def version
  @version
end

Instance Method Details

#dateObject



35
36
37
# File 'lib/cocoapods-vemars/command/basicInfo.rb', line 35

def date
  Time.now.strftime "%m/%d/%Y"
end

#user_emailObject



47
48
49
# File 'lib/cocoapods-vemars/command/basicInfo.rb', line 47

def user_email
  (`git config user.email` || "bytedance@bytedance.com").strip
end

#user_nameObject



43
44
45
# File 'lib/cocoapods-vemars/command/basicInfo.rb', line 43

def user_name
  (`git config user.name` || "bytedance" ).strip
end

#yearObject



39
40
41
# File 'lib/cocoapods-vemars/command/basicInfo.rb', line 39

def year
  Time.now.year.to_s
end