Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add examples/ folder

  • Loading branch information...
commit 067bcb4135a74e92ab86668eb40c2d53afb3daeb 1 parent 30d4039
@rrrene authored
Showing with 31 additions and 0 deletions.
  1. +7 −0 examples/issues.rb
  2. +24 −0 examples/issues_colored.rb
View
7 examples/issues.rb
@@ -0,0 +1,7 @@
+require 'sparkr'
+
+open_issue_count = 3
+closed_issue_count = 13
+
+list = [open_issue_count, closed_issue_count]
+puts "Issues: " + Sparkr.sparkline(list)
View
24 examples/issues_colored.rb
@@ -0,0 +1,24 @@
+require 'sparkr'
+#
+# You need Term::ANSIColor for this example:
+#
+# $ gem install term-ansicolor
+#
+require 'term/ansicolor'
+
+class String
+ include Term::ANSIColor
+end
+
+open_issue_count = 3
+closed_issue_count = 13
+
+list = [open_issue_count, closed_issue_count]
+sparkline = Sparkr.sparkline(list) do |tick, count, index|
+ if index == 0
+ tick.color(:red)
+ else
+ tick.color(:green)
+ end
+end
+puts "Issues: " + sparkline
Please sign in to comment.
Something went wrong with that request. Please try again.