Class: Vcsmap::Plugin::GithubSublimesettings
- Inherits:
-
BasePlugin
- Object
- BasePlugin
- Vcsmap::Plugin::GithubSublimesettings
- Defined in:
- lib/vcsmap/plugins/github_sublimesettings.rb
Instance Attribute Summary
Attributes inherited from BasePlugin
Instance Method Summary collapse
- #credentials(file) ⇒ Object
-
#initialize ⇒ GithubSublimesettings
constructor
A new instance of GithubSublimesettings.
- #table_header ⇒ Object
Methods inherited from BasePlugin
Constructor Details
#initialize ⇒ GithubSublimesettings
Returns a new instance of GithubSublimesettings.
4 5 6 7 |
# File 'lib/vcsmap/plugins/github_sublimesettings.rb', line 4 def initialize @search_string = 'filename:GitHub.sublime-settings+github_token' @token_regex = /(?:\"|')github_token(?:\"|')\:(?:\ |)(?:\"|')(.*?)(?:\"|')/i end |
Instance Method Details
#credentials(file) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/vcsmap/plugins/github_sublimesettings.rb', line 9 def credentials(file) @token = capture_match(@token_regex, file) ['GitHub token', @token] rescue NoMethodError [] end |
#table_header ⇒ Object
16 17 18 |
# File 'lib/vcsmap/plugins/github_sublimesettings.rb', line 16 def table_header %w(Protocol Token) end |