Class: Rouge::CLI::Style
- Inherits:
-
Rouge::CLI
- Object
- Rouge::CLI
- Rouge::CLI::Style
- Defined in:
- lib/rouge/cli.rb
Class Method Summary collapse
- .desc ⇒ Object
- .doc {|%|usage: rougify style [<theme-name>] [<options>]|| ... } ⇒ Object
- .parse(argv) ⇒ Object
Instance Method Summary collapse
-
#initialize(opts) ⇒ Style
constructor
A new instance of Style.
- #run ⇒ Object
Methods inherited from Rouge::CLI
Constructor Details
Class Method Details
.desc ⇒ Object
244 245 246 |
# File 'lib/rouge/cli.rb', line 244 def self.desc "print CSS styles" end |
.doc {|%|usage: rougify style [<theme-name>] [<options>]|| ... } ⇒ Object
248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/rouge/cli.rb', line 248 def self.doc return enum_for(:doc) unless block_given? yield %|usage: rougify style [<theme-name>] [<options>]| yield %|| yield %|Print CSS styles for the given theme. Extra options are| yield %|passed to the theme. Theme defaults to thankful_eyes.| yield %|| yield %|options:| yield %| --scope (default: .highlight) a css selector to scope by| end |
.parse(argv) ⇒ Object
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 |
# File 'lib/rouge/cli.rb', line 260 def self.parse(argv) opts = { :theme_name => 'thankful_eyes' } until argv.empty? arg = argv.shift case arg when /--(\w+)/ opts[$1.tr('-', '_').to_sym] = argv.shift else opts[:theme_name] = arg end end new(opts) end |
Instance Method Details
#run ⇒ Object
283 284 285 |
# File 'lib/rouge/cli.rb', line 283 def run @theme.render(&method(:puts)) end |