Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream changes #1

Open
wants to merge 85 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
4a042c5
adding pessimistic versioning for gem dependencies
pseudomuto Dec 18, 2013
69ed82e
adding haml to dev dependencies so all tests run
pseudomuto Dec 18, 2013
c3a7279
switching from test unit to minitest
pseudomuto Dec 18, 2013
d0eef2d
moving cli to lib and updating bin file
pseudomuto Dec 19, 2013
0c1adbd
adding simplecov for verifying test coverage
pseudomuto Dec 19, 2013
fbc9497
moving app to it's own file under lib/dashing
pseudomuto Dec 19, 2013
e975ce7
light refactoring for better test coverage
pseudomuto Dec 19, 2013
333f5b2
updating javascripts path
pseudomuto Dec 19, 2013
c49b9bc
removing and ignoring .ruby-version
pseudomuto Jan 6, 2014
9e8dfe7
Merge pull request #296 from Shopify/updating_gems_and_refactoring
pushmatrix Jan 13, 2014
628242b
Update lastEvents if a widget exists.
boxiong Jan 16, 2014
6f097d8
Making meter-widget adjustable
Mar 12, 2014
76a645b
Adding Suffix and Prefix to Meter-Widget
Mar 12, 2014
180006a
Update License Date
nmn Mar 14, 2014
ff3acd8
Merge pull request #335 from naman34/patch-1
pushmatrix Mar 14, 2014
6c58c68
upgrade gridster.js to v0.5.1
liln May 19, 2014
9927795
use default release task from bundler/gem_tasks
May 27, 2014
d773b37
deploy using shipit
May 27, 2014
b5da76a
Bump version to 1.3.3
May 27, 2014
a2ae80d
s.executables may be nil sometimes
May 28, 2014
f965d34
Update ruby to 2.1.2
padi May 29, 2014
81ef43d
Merge pull request #364 from padi/patch-1
pushmatrix May 30, 2014
d3ccecb
Don't start the dashing app when you run the bin file.
pushmatrix May 30, 2014
9ee7f9e
Merge pull request #366 from Shopify/prevent_double_load
pushmatrix May 30, 2014
391a270
Updated to latest twitter gem.
pushmatrix May 30, 2014
ea3730f
Lock Dashing on Rufus Scheduler 2.0.24. There are some small issues f…
pushmatrix May 30, 2014
c498810
Update Dashing to 1.3.4
pushmatrix May 30, 2014
a615548
Close event connections when the server is gracefully shutting down.
dylanahsmith Jun 19, 2014
b026cc3
Merge pull request #383 from Shopify/close-connections-on-stop
dylanahsmith Jun 19, 2014
55f9093
Duplicate array of connections before closing them on thin server stop.
dylanahsmith Jun 21, 2014
3343a27
.icon-background should not block click
hSATAC Jul 23, 2014
16b4c4c
Merge pull request #406 from hSATAC/feature/fix-icon-blocking-click
pushmatrix Jul 23, 2014
6c6d71c
Merge pull request #303 from boxiong/master
pushmatrix Jul 28, 2014
e42fc5d
Possible to skip overwrites when installing widget.
frvi Aug 28, 2014
8fe3a7e
Updated tests accordingly.
frvi Aug 28, 2014
aa997ac
Enable data suffix
Sep 9, 2014
cef86d2
Ignore log directory
Jan 22, 2015
e16d474
Padding on Graph widget to avoid cropping labels
Jan 29, 2015
f4b121e
Merge pull request #510 from tylermauthe/tylermauthe-graph-fixlabels
pushmatrix Jan 29, 2015
cfed24e
Ignore tmp/ and history.yml
Jan 29, 2015
6914d99
Trigger onData on widget initialization
adambyrtek Feb 24, 2015
e18a162
Store last events for all widgets
adambyrtek Feb 24, 2015
c49e181
Send last event data when a widget is ready
adambyrtek Feb 24, 2015
937fcce
Pass `status` option to `send_file` and make sure a 404 is returned.
svendahlstrand Apr 26, 2015
66cd203
Merge pull request #558 from svendahlstrand/fix_404
pushmatrix Apr 27, 2015
5c4e62f
Set public folder setting for generated project.
svendahlstrand Apr 29, 2015
6955486
Remove redundant test.
svendahlstrand Apr 29, 2015
439182f
Merge pull request #560 from svendahlstrand/remove_redundant_test
pushmatrix Apr 30, 2015
9d5fb04
add travis link and simplify link to license file
hennr Jun 1, 2015
ea038dd
Merge pull request #574 from hennr/patch-1
pushmatrix Jun 1, 2015
c33052f
Update License Copyright date
pushmatrix Jun 1, 2015
bf4a9b8
Merge pull request #506 from kassi/ignore-logs
pushmatrix Jun 8, 2015
203abd6
Merge pull request #438 from schinken/graph-suffix
pushmatrix Jun 8, 2015
1582eb9
Merge pull request #433 from frvi/master
pushmatrix Jun 8, 2015
56162f6
Merge pull request #333 from mr-deamon/meter-suffix-prefix
pushmatrix Jun 8, 2015
ca2dad4
Merge pull request #360 from liln/master
pushmatrix Jun 8, 2015
e386ae8
Squashed commit of the following:
Jun 11, 2015
de30f5e
Merge pull request #579 from tylermauthe/master
pushmatrix Jun 11, 2015
b196298
Update CONTRIBUTING.md
pushmatrix Jun 11, 2015
0765825
bump rack for security
orenmazor Jun 17, 2015
d2cd3a8
Merge pull request #580 from Shopify/bump_rack
orenmazor Jun 17, 2015
581123f
Allow thor 0.19.0
ball-hayden Jul 1, 2015
4991e09
Merge pull request #589 from SparkSeat/master
pushmatrix Jul 8, 2015
5a0bdd9
Merge pull request #521 from adambyrtek/last-event-triggers-ondata
pushmatrix Jul 10, 2015
c601933
Adding MIT license to the gemspec.
reiz Nov 18, 2015
5b585d5
Merge pull request #637 from reiz/patch-1
pushmatrix Nov 18, 2015
5b7ea3f
:art: fix indentation
manuelmeurer Dec 2, 2015
e02401e
Merge pull request #641 from krautcomputing/fix_indentation
pushmatrix Dec 7, 2015
f8d316e
Refactor and fix authentication
byroot Dec 8, 2015
56de2ad
Merge pull request #644 from Shopify/refactor-auth
pushmatrix Dec 8, 2015
cffe451
Update year to 2016
prayagverma Jan 16, 2016
8a695bd
Merge pull request #664 from pra85/2016
pushmatrix Jan 17, 2016
d1d0309
Update travis config to current ruby versions.
qbrossard Feb 15, 2016
5c44600
Merge pull request #683 from qbrossard/fix-travis-configuration
pushmatrix Feb 16, 2016
1b1e390
Updated to use FontAwesome 4.5.0
jmb Feb 22, 2016
64ffae5
Merge pull request #687 from jmb/fontawesome-4.5.0
pushmatrix Apr 1, 2016
c5bb690
Update README.md
pushmatrix Apr 12, 2016
0daba09
Update CONTRIBUTING.md
pushmatrix Apr 12, 2016
8b634d1
Update CONTRIBUTING.md
pushmatrix Apr 12, 2016
4a4b677
Update CONTRIBUTING.md
pushmatrix Apr 12, 2016
1d33b6f
Bump gem spec to latest version.
pushmatrix Apr 12, 2016
ed5463d
Update to latest version.
pushmatrix Apr 12, 2016
61435e9
Mention the fork in the readme
pushmatrix Jun 13, 2016
ac35813
Fix gemspec to have correct date
pushmatrix Jul 11, 2016
bc1c106
Fix spacing issue
pushmatrix Aug 1, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
*DS_STORE
/Gemfile.lock
*.gem
*.gem
coverage/
log/
tmp/
.ruby-version
history.yml
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: ruby
rvm:
- 2.0.0
- 1.9.3
- 2.3.0
- 2.2.4
- 2.1.8

script: "rake test"
script: "rake test"
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<a name="issues"></a>
## Have an Issue?

Dashing is no longer being actively maintained.

1. Check the [Troubleshooting Guide](https://github.com/Shopify/dashing/wiki#how-tos) in the wiki.
2. Use the [GitHub Issue Search](https://help.github.com/articles/searching-issues/) to check if the issue has already been reported.
3. You can ask your issue on the tracker, but your best bet is to go to [Stack Overflow](http://stackoverflow.com/questions/tagged/dashing)


<a name="features"></a>

If you feel that you have a really amazing, super neato idea that should be a part of Dashing, it may be a good candidate for an external Gem which supercharges a project. An excellent example of this is
[dashing-contrib](https://github.com/QubitProducts/dashing-contrib). If you
do create a third-party extension for Dashing, please add it [here](https://github.com/Shopify/dashing/wiki/Additional-Widgets#other-third-party-tools).

2 changes: 1 addition & 1 deletion MIT-LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2013 Shopify
Copyright (c) 2016 Shopify

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# [Dashing](http://shopify.github.com/dashing)
![](https://api.travis-ci.org/Shopify/dashing.png)
[![Build Status](https://secure.travis-ci.org/Shopify/dashing.png?branch=master)](http://travis-ci.org/Shopify/dashing)

Dashing is a Sinatra based framework that lets you build beautiful dashboards. It looks especially great on TVs.

[Check out the homepage](http://shopify.github.com/dashing).

Note: Dashing is no longer being actively maintained. Read about it [here](https://github.com/Shopify/dashing/issues/711). There is a fork of the project being maintained at at [https://github.com/dashing-io/dashing](https://github.com/dashing-io/dashing)

# License
Distributed under the [MIT license](https://github.com/Shopify/dashing/blob/master/MIT-LICENSE)
Distributed under the [MIT license](MIT-LICENSE)
3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
require 'rubygems'
require 'rake'
require 'bundler/gem_tasks'

require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/**/*_test.rb'
end

task :default => [:test]
task :default => [:test]
119 changes: 8 additions & 111 deletions bin/dashing
Original file line number Diff line number Diff line change
@@ -1,112 +1,9 @@
#!/usr/bin/env ruby

require 'thor'
require 'net/http'
require 'json'
require 'open-uri'

class MockScheduler
def method_missing(*args)
yield
end
end

SCHEDULER = MockScheduler.new

module Dashing

class CLI < Thor
include Thor::Actions

class << self
attr_accessor :auth_token

def hyphenate(str)
return str.downcase if str =~ /^[A-Z-]+$/
str.gsub('_', '-').gsub(/\B[A-Z]/, '-\&').squeeze('-').downcase
end
end

attr_accessor :name

no_tasks do
['widget', 'dashboard', 'job'].each do |type|
define_method "generate_#{type}" do |name|
@name = Thor::Util.snake_case(name)
directory type.to_sym, File.join("#{type}s")
end
end
end

def self.source_root
File.expand_path('../../templates', __FILE__)
end

desc "new PROJECT_NAME", "Sets up ALL THE THINGS needed for your dashboard project."
def new(name)
@name = Thor::Util.snake_case(name)
directory :project, @name
end

desc "generate (widget/dashboard/job) NAME", "Creates a new widget, dashboard, or job."
def generate(type, name)
send("generate_#{type}".to_sym, name)
rescue NoMethodError => e
puts "Invalid generator. Either use widget, dashboard, or job"
end
map "g" => :generate

desc "install GIST_ID", "Installs a new widget from a gist."
def install(gist_id)
public_url = "https://gist.github.com/#{gist_id}"
gist = JSON.parse(open("https://api.github.com/gists/#{gist_id}").read)

gist['files'].each do |filename, contents|
if filename.end_with?(".rb")
create_file File.join(Dir.pwd, 'jobs', filename), contents['content']
elsif filename.end_with?(".coffee", ".html", ".scss")
widget_name = File.basename(filename, '.*')
create_file File.join(Dir.pwd, 'widgets', widget_name, filename), contents['content']
end
end

print set_color("Don't forget to edit the ", :yellow)
print set_color("Gemfile ", :yellow, :bold)
print set_color("and run ", :yellow)
print set_color("bundle install ", :yellow, :bold)
say set_color("if needed. More information for this widget can be found at #{public_url}", :yellow)

rescue OpenURI::HTTPError => e
say set_color("Could not find gist at #{public_url}"), :red
end
map "i" => :install

desc "start", "Starts the server in style!"
method_option :job_path, :desc => "Specify the directory where jobs are stored"
def start(*args)
port_option = args.include?('-p')? '' : ' -p 3030'
args = args.join(" ")
command = "bundle exec thin -R config.ru start #{port_option} #{args}"
command.prepend "export JOB_PATH=#{options[:job_path]}; " if options[:job_path]
system(command)
end
map "s" => :start

desc "stop", "Stops the thin server"
def stop
command = "bundle exec thin stop"
system(command)
end

desc "job JOB_NAME AUTH_TOKEN(optional)", "Runs the specified job. Make sure to supply your auth token if you have one set."
def job(name, auth_token = "")
Dir[File.join(Dir.pwd, 'lib/**/*.rb')].each {|file| require file }
self.class.auth_token = auth_token
f = File.join(Dir.pwd, "jobs", "#{name}.rb")
require f
end

end
end

Dashing::CLI.start
require "pathname"
bin_file = Pathname.new(__FILE__).realpath
$:.unshift File.expand_path("../../lib", bin_file)

require 'dashing/cli'
require 'dashing/downloader'
Dashing::CLI.source_root(File.expand_path('../../templates', bin_file))
Dashing::CLI.start(ARGV)
36 changes: 21 additions & 15 deletions dashing.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,35 @@

Gem::Specification.new do |s|
s.name = 'dashing'
s.version = '1.3.2'
s.date = '2013-11-21'
s.executables << 'dashing'
s.version = '1.3.7'
s.date = '2016-04-11'
s.executables = %w(dashing)


s.summary = "The exceptionally handsome dashboard framework."
s.description = "This framework lets you build & easily layout dashboards with your own custom widgets. Use it to make a status boards for your ops team, or use it to track signups, conversion rates, or whatever else metrics you'd like to see in one spot. Included with the framework are ready-made widgets for you to use or customize. All of this code was extracted out of a project at Shopify that displays dashboards on TVs around the office."
s.author = "Daniel Beauchamp"
s.email = '[email protected]'
s.files = ["lib/Dashing.rb"]
s.homepage = 'http://shopify.github.com/dashing'
s.license = "MIT"

s.files = Dir['README.md', 'javascripts/**/*', 'templates/**/*','templates/**/.[a-z]*', 'lib/**/*']

s.add_dependency('sass')
s.add_dependency('coffee-script', '>=1.6.2')
s.add_dependency('execjs', '>=2.0.0')
s.add_dependency('sinatra')
s.add_dependency('sinatra-contrib')
s.add_dependency('thin')
s.add_dependency('rufus-scheduler', '~> 2.0')
s.add_dependency('thor')
s.add_dependency('sprockets')
s.add_dependency('rack')
s.add_dependency('sass', '~> 3.2.12')
s.add_dependency('coffee-script', '~> 2.2.0')
s.add_dependency('execjs', '~> 2.0.2')
s.add_dependency('sinatra', '~> 1.4.4')
s.add_dependency('sinatra-contrib', '~> 1.4.2')
s.add_dependency('thin', '~> 1.6.1')
s.add_dependency('rufus-scheduler', '~> 2.0.24')
s.add_dependency('thor', '> 0.18.1')
s.add_dependency('sprockets', '~> 2.10.1')
s.add_dependency('rack', '~> 1.5.4')

end
s.add_development_dependency('rake', '~> 10.1.0')
s.add_development_dependency('haml', '~> 4.0.4')
s.add_development_dependency('minitest', '~> 5.2.0')
s.add_development_dependency('mocha', '~> 0.14.0')
s.add_development_dependency('fakeweb', '~> 1.3.0')
s.add_development_dependency('simplecov', '~> 0.8.2')
end
7 changes: 6 additions & 1 deletion javascripts/dashing.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class Dashing.Widget extends Batman.View
@mixin($(@node).data())
Dashing.widgets[@id] ||= []
Dashing.widgets[@id].push(@)
@mixin(Dashing.lastEvents[@id]) # in case the events from the server came before the widget was rendered

type = Batman.Filters.dashize(@view)
$(@node).addClass("widget widget-#{type} #{@id}")
Expand All @@ -55,6 +54,12 @@ class Dashing.Widget extends Batman.View
@::on 'ready', ->
Dashing.Widget.fire 'ready'

# In case the events from the server came before the widget was rendered
lastData = Dashing.lastEvents[@id]
if lastData
@mixin(lastData)
@onData(lastData)

receiveData: (data) =>
@mixin(data)
@onData(data)
Expand Down
Loading