cert_open_data_visualizer 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile.lock CHANGED
@@ -1,13 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cert_open_data_visualizer (0.0.5)
4
+ cert_open_data_visualizer (0.0.6)
5
+ haml (~> 4.0.4)
5
6
  httparty (~> 0.12.0)
6
7
  sinatra (~> 1.4.4)
7
8
 
8
9
  GEM
9
10
  remote: https://rubygems.org/
10
11
  specs:
12
+ haml (4.0.4)
13
+ tilt
11
14
  httparty (0.12.0)
12
15
  json (~> 1.8)
13
16
  multi_xml (>= 0.5.2)
@@ -18,6 +18,10 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ gem 'sinatra'
22
+ gem 'haml'
23
+
24
+ spec.add_dependency "haml", "~> 4.0.4 "
21
25
  spec.add_dependency "sinatra", "~> 1.4.4 "
22
26
  spec.add_dependency "httparty", "~> 0.12.0 "
23
27
  spec.add_development_dependency "bundler", "~> 1.3"
@@ -27,7 +27,9 @@ class CertDataVisualizer
27
27
  end
28
28
 
29
29
  def clean_cache!
30
+ puts "Cleaning cache!"
30
31
  CertOpenDataVisualizer::DummyCacher.new.clean!
32
+ puts "Done!"
31
33
  end
32
34
 
33
35
  def fetch!
@@ -9,9 +9,8 @@ module CertOpenDataVisualizer
9
9
  end
10
10
 
11
11
  # Yep, well just overwrite it if it exists
12
- def cache_file(path)
13
- FileUtils.mkdir_p( File.join(Dir.tmpdir, "cert"))
14
- FileUtils.cp(path, File.join(Dir.tmpdir, "cert"))
12
+ def cache_file(file)
13
+ FileUtils.cp(file, path)
15
14
  end
16
15
 
17
16
  def write_file_to_cache(filename, contents)
@@ -2,14 +2,15 @@
2
2
 
3
3
  ## How to use
4
4
 
5
- *precondition* ruby 1.9.3 or newer version installed
5
+ When running using `cert_open_data_visualizer` gem
6
6
 
7
- Install required gems
8
- `bundle install`
9
-
10
- Run frontend
11
- `bundle exec rackup`
12
-
13
- Then open your browser [http://127.0.0.1:9292](http://127.0.0.1:9292)
7
+ ```bash
8
+ $ cert_open_data_visualizer app
9
+ == Sinatra/1.4.4 has taken the stage on 4567 for development with backup from Thin
10
+ >> Thin web server (v1.5.1 codename Straight Razor)
11
+ >> Maximum connections set to 1024
12
+ >> Listening on localhost:4567, CTRL+C to stop
13
+ ```
14
+ Open your browser to [http://127.0.0.1:9292](http://127.0.0.1:9292)
14
15
 
15
16
  On top of website are links for homepage, page to view graphs and page to clear cache, reload and reparse data
@@ -1,3 +1,3 @@
1
1
  module CertOpenDataVisualizer
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -3,6 +3,7 @@ module CertOpenDataVisualizer
3
3
  require 'httparty'
4
4
  require 'tmpdir'
5
5
  require 'csv'
6
+
6
7
  class Visualize
7
8
  attr_accessor :all_data, :cacher
8
9
  CSV_DATA_URL = "http://pilvilinna.cert.fi/opendata/autoreporter/csv.zip"
@@ -20,6 +21,7 @@ module CertOpenDataVisualizer
20
21
 
21
22
  def maybe_download
22
23
  if @cacher.file_exists?("cert.zip")
24
+ puts "Loading data from cache"
23
25
  @cacher.get_from_cache("cert.zip")
24
26
  else
25
27
  download
@@ -29,6 +31,7 @@ module CertOpenDataVisualizer
29
31
  def download
30
32
  puts "Downloading, may take a while depending on your connection"
31
33
  data = HTTParty.get(CSV_DATA_URL).body
34
+ puts "Done"
32
35
  write_tmp_file(data)
33
36
  end
34
37
 
@@ -56,6 +59,8 @@ module CertOpenDataVisualizer
56
59
  csvs.reject! {|row| row[0].include?('#') || row[5].nil? || row[5] == ""}
57
60
  csvs
58
61
  end
62
+ puts "Done"
63
+ csvs
59
64
  end
60
65
 
61
66
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cert_open_data_visualizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,6 +11,22 @@ bindir: bin
11
11
  cert_chain: []
12
12
  date: 2013-12-07 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: haml
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 4.0.4
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 4.0.4
14
30
  - !ruby/object:Gem::Dependency
15
31
  name: sinatra
16
32
  requirement: !ruby/object:Gem::Requirement
@@ -94,11 +110,8 @@ files:
94
110
  - lib/cert_open_data_visualizer/cli.rb
95
111
  - lib/cert_open_data_visualizer/dummy_cacher.rb
96
112
  - lib/cert_open_data_visualizer/formatter.rb
97
- - lib/cert_open_data_visualizer/frontend/Gemfile
98
- - lib/cert_open_data_visualizer/frontend/Gemfile.lock
99
113
  - lib/cert_open_data_visualizer/frontend/Readme.md
100
114
  - lib/cert_open_data_visualizer/frontend/app.rb
101
- - lib/cert_open_data_visualizer/frontend/config.ru
102
115
  - lib/cert_open_data_visualizer/frontend/public/bootstrap.min.css
103
116
  - lib/cert_open_data_visualizer/frontend/public/bootstrap.min.js
104
117
  - lib/cert_open_data_visualizer/frontend/public/javascripts/bootstrap.min.js
@@ -1,6 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'cert_open_data_visualizer', '~>0.0.5'
4
- gem 'sinatra'
5
- gem 'haml'
6
-
@@ -1,28 +0,0 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
- cert_open_data_visualizer (0.0.5)
5
- httparty (~> 0.12.0)
6
- haml (4.0.4)
7
- tilt
8
- httparty (0.12.0)
9
- json (~> 1.8)
10
- multi_xml (>= 0.5.2)
11
- json (1.8.1)
12
- multi_xml (0.5.5)
13
- rack (1.5.2)
14
- rack-protection (1.5.1)
15
- rack
16
- sinatra (1.4.4)
17
- rack (~> 1.4)
18
- rack-protection (~> 1.4)
19
- tilt (~> 1.3, >= 1.3.4)
20
- tilt (1.4.1)
21
-
22
- PLATFORMS
23
- ruby
24
-
25
- DEPENDENCIES
26
- cert_open_data_visualizer (~> 0.0.5)
27
- haml
28
- sinatra
@@ -1,3 +0,0 @@
1
- require './app'
2
-
3
- run App.new