Class: YKPod::YKCreatePodConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-ykutility/command/create/yk_create_pod_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeYKCreatePodConfig

Returns a new instance of YKCreatePodConfig.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/cocoapods-ykutility/command/create/yk_create_pod_config.rb', line 7

def initialize
  @name = ''
  @language = ''
  @with_demo = true
  @with_register = false

  user_name = open('|git config --global user.name').gets
  user_name = user_name.blank? ? 'xxximac' : user_name
  user_email = open('|git config --global user.email').gets
  user_email = user_email.blank? ? '[email protected]' : user_email
  @author = user_name.strip.gsub('.', '')
  @author_email = user_email.strip
  @prefix = 'ST'
  @path = File.expand_path(Dir.getwd.to_s)
end

Instance Attribute Details

#authorObject

Returns the value of attribute author.



5
6
7
# File 'lib/cocoapods-ykutility/command/create/yk_create_pod_config.rb', line 5

def author
  @author
end

#author_emailObject

Returns the value of attribute author_email.



5
6
7
# File 'lib/cocoapods-ykutility/command/create/yk_create_pod_config.rb', line 5

def author_email
  @author_email
end

#languageObject

Returns the value of attribute language.



5
6
7
# File 'lib/cocoapods-ykutility/command/create/yk_create_pod_config.rb', line 5

def language
  @language
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/cocoapods-ykutility/command/create/yk_create_pod_config.rb', line 5

def name
  @name
end

#pathObject

Returns the value of attribute path.



5
6
7
# File 'lib/cocoapods-ykutility/command/create/yk_create_pod_config.rb', line 5

def path
  @path
end

#prefixObject

Returns the value of attribute prefix.



5
6
7
# File 'lib/cocoapods-ykutility/command/create/yk_create_pod_config.rb', line 5

def prefix
  @prefix
end

#with_demoObject

Returns the value of attribute with_demo.



5
6
7
# File 'lib/cocoapods-ykutility/command/create/yk_create_pod_config.rb', line 5

def with_demo
  @with_demo
end

#with_registerObject

Returns the value of attribute with_register.



5
6
7
# File 'lib/cocoapods-ykutility/command/create/yk_create_pod_config.rb', line 5

def with_register
  @with_register
end

Instance Method Details

#prefix_nameObject



23
24
25
# File 'lib/cocoapods-ykutility/command/create/yk_create_pod_config.rb', line 23

def prefix_name
  name.start_with?(prefix) ? name : prefix + name
end