Class: GithubMembers::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/github_members/options.rb

Defined Under Namespace

Classes: ParseError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Options

Returns a new instance of Options.



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/github_members/options.rb', line 16

def initialize(argv)
  self.github_token = ENV["GITHUB_TOKEN"].to_s

  args = parser.parse!(argv)
  self.help = parser.help + help_examples(parser.program_name)
  self.github_org = args.first
  self.markdown_file = Pathname(markdown_file || Defaults::MARKDOWN_FILE)
  self.yaml_file = Pathname(yaml_file || Defaults::YAML_FILE)
rescue OptionParser::ParseError => e
  raise ParseError, e.message
end

Instance Attribute Details

#fieldsObject

Returns the value of attribute fields.



11
12
13
# File 'lib/github_members/options.rb', line 11

def fields
  @fields
end

#github_orgObject

Returns the value of attribute github_org.



7
8
9
# File 'lib/github_members/options.rb', line 7

def github_org
  @github_org
end

#github_tokenObject

Returns the value of attribute github_token.



8
9
10
# File 'lib/github_members/options.rb', line 8

def github_token
  @github_token
end

#helpObject

Returns the value of attribute help.



12
13
14
# File 'lib/github_members/options.rb', line 12

def help
  @help
end

#help_shownObject

Returns the value of attribute help_shown.



13
14
15
# File 'lib/github_members/options.rb', line 13

def help_shown
  @help_shown
end

#markdown_fileObject

Returns the value of attribute markdown_file.



9
10
11
# File 'lib/github_members/options.rb', line 9

def markdown_file
  @markdown_file
end

#versionObject

Returns the value of attribute version.



14
15
16
# File 'lib/github_members/options.rb', line 14

def version
  @version
end

#yaml_fileObject

Returns the value of attribute yaml_file.



10
11
12
# File 'lib/github_members/options.rb', line 10

def yaml_file
  @yaml_file
end