focuslight 0.1.4 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 51b11a9f7f6bda320667d5ae7b21209d5191653d
4
- data.tar.gz: c03705eec5c79ba6a0a958c60081dc8d8140cf9b
2
+ SHA256:
3
+ metadata.gz: f392ede3eb9c48a3ec3dbe74aea3af5f15c8437a1fb3f0990929fb21e4e1422e
4
+ data.tar.gz: b82c5ab13f118d8eed164759713eb449442b5d1bf14774710a3ae1ce8b9271b1
5
5
  SHA512:
6
- metadata.gz: d121500a5835a361d07d43dd8a43a5547fb3fa3b00df0a538ba292a18cb0fc563a5029d2061c2834a5beedccd4bbbfc8803b1e0d9f3a31c205d77696c9e35cb3
7
- data.tar.gz: b580aee081ec57efd5dd17b5f7e74e43db9f59c55f41fb46c2969dde3ff5591e44afda6585bc7c261a6a45cad02cbaa2940367dc4b47709cd57d8093fe3b08a2
6
+ metadata.gz: 9005817ad6b4469234162451434b19cdab46a008bcceb88fa89a804439cb9dfd98ac3e0f7e212be8dddd9742049d66095bd9ed469fa37d8b46e6e7a801a76a68
7
+ data.tar.gz: 4b273f96970e9695cfa98d32f5ed644542d63e168f036afb57971594f3489946a4153985cbb3f6c8afff346b0e85398853f848b0258e4c903f01207e5c11161d
data/.dockerignore ADDED
@@ -0,0 +1,2 @@
1
+ .env
2
+ vendor
@@ -0,0 +1,39 @@
1
+ name: "Unit test on Ubuntu"
2
+
3
+ on:
4
+ push:
5
+ branches: "*"
6
+
7
+ jobs:
8
+ test:
9
+ strategy:
10
+ matrix:
11
+ os: [ubuntu-16.04, ubuntu-18.04]
12
+ ruby: [2.5, 2.6, 2.7]
13
+ fail-fast: false
14
+ runs-on: ${{ matrix.os }}
15
+ steps:
16
+ - uses: actions/checkout@v1
17
+ - name: Set up package
18
+ run: |
19
+ sudo apt-get update
20
+ sudo apt-get install -y build-essential mysql-client libsqlite3-dev rrdtool librrd-dev
21
+
22
+ - name: Set up Ruby version
23
+ uses: ruby/setup-ruby@v1
24
+ with:
25
+ ruby-version: ${{ matrix.ruby }}
26
+ bundler-cache: true
27
+
28
+ - name: Set up bundler
29
+ run: |
30
+ gem install bundler --no-document
31
+ # bundle config set deployment 'true'
32
+
33
+ - name: bundle install
34
+ run: bundle install --jobs 4 --retry 3
35
+
36
+ - name: test
37
+ run: |
38
+ bundle exec focuslight init
39
+ bundle exec rake
data/.gitignore CHANGED
@@ -20,3 +20,4 @@ data/
20
20
  log/
21
21
  *.log
22
22
  focuslight/
23
+ .env
data/.travis.yml CHANGED
@@ -1,9 +1,13 @@
1
+ language: ruby
1
2
  rvm:
2
- - 2.0.0
3
- - 2.1
3
+ - 2.7
4
4
  gemfile:
5
5
  - Gemfile
6
+ bundler_args:
7
+ cache: bundler
6
8
  before_install:
7
- - sudo apt-get install rrdtool librrd-dev
9
+ - sudo apt-get install rrdtool librrd-dev sqlite3 libsqlite3-dev
10
+ - gem install -v "2.1.4" bundler
11
+ - bundle config set path vendor/bundle
8
12
  before_script:
9
13
  - bundle exec focuslight init
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # 0.2.0 (2019/04/20)
2
+
3
+ Enhancements:
4
+
5
+ * Support Ruby version 2.5 higher
6
+
7
+ Fixes:
8
+
9
+ * Security fix:
10
+ * ffi, rack, rack-protection
11
+ * Fix ulimti/llimit check
12
+
1
13
  # 0.1.4 (2014/06/11)
2
14
 
3
15
  Enhancements:
data/Dockerfile ADDED
@@ -0,0 +1,17 @@
1
+ FROM ruby:2.7.2
2
+ RUN apt-get update && apt-get install -y \
3
+ build-essential \
4
+ default-mysql-client \
5
+ libsqlite3-dev \
6
+ rrdtool librrd-dev
7
+
8
+ WORKDIR /app
9
+
10
+ ADD Gemfile /app/Gemfile
11
+ ADD Gemfile.lock /app/Gemfile.lock
12
+ ADD focuslight.gemspec /app/focuslight.gemspec
13
+ ADD lib/focuslight/version.rb /app/lib/focuslight/version.rb
14
+ RUN gem install bundler
15
+ RUN bundle install
16
+ ADD . /app
17
+ RUN rm -rf /var/lib/apt/lists/*
data/README.md CHANGED
@@ -25,7 +25,7 @@ RRDTool and its dependencies must be installed before installing Focuslight.
25
25
 
26
26
  ## Installation
27
27
 
28
- Install focuslight with Ruby 2.0 or later.
28
+ Install focuslight with Ruby 2.4 or later.
29
29
 
30
30
  ### Gem package
31
31
 
@@ -70,6 +70,21 @@ mysql> GRANT CREATE, ALTER, DELETE, INSERT, UPDATE, SELECT \\
70
70
 
71
71
  After that, follow the same procedure with the SQLite case.
72
72
 
73
+ ### Using Docker
74
+
75
+ You can use Docker to build a focuslight development environment for MySQL.
76
+
77
+ bash
78
+ $ git clone https://github.com/focuslight/focuslight.git
79
+ $ cd focuslight
80
+ $ docker-compose build
81
+ $ docker-compose up
82
+ $ docker-compose exec app bash
83
+ $ mysql -u root -proot -h db
84
+ mysql> CREATE DATABASE focuslight;
85
+ mysql> \q
86
+ $ bundle exec focuslight init
87
+
73
88
  ## Configuration
74
89
 
75
90
  To configure Focuslight, edit the `.env` file in the project root directory.
@@ -85,6 +100,7 @@ HOST=0.0.0.0
85
100
  # 1MIN_METRICS=n
86
101
  FLOAT_SUPPORT=n # y
87
102
  DBURL=sqlite://data/gforecast.db
103
+ DBTIMEOUT=60000
88
104
  # DBURL=mysql2://root:@localhost/focuslight
89
105
  # RRDCACHED=n
90
106
  # MOUNT=/
@@ -97,6 +113,14 @@ LOG_LEVEL=warn
97
113
  1. Copy GrowthForecast's `datadir` directory (and its contents) to `./data` (or where you specified)
98
114
  1. Execute Focuslight
99
115
 
116
+ ## Example: Creating a New Graph
117
+
118
+ Using curl:
119
+
120
+ ```
121
+ $ curl -F number=10 http://localhost:5125/api/socialgame/member/register
122
+ ```
123
+
100
124
  ## TODO
101
125
 
102
126
  * Merge GrowthForecast's commits after Jan 09, 2014
@@ -0,0 +1,35 @@
1
+ version: '3.8'
2
+ services:
3
+ app:
4
+ build: .
5
+ command: /bin/sh -c "bundle install -j 4 && bundle exec focuslight start"
6
+ ports:
7
+ - '5125:5125'
8
+ volumes:
9
+ - .:/app
10
+ - gem-data:/usr/local/bundle
11
+ environment:
12
+ DATADIR: ./data
13
+ PORT: 5125
14
+ HOST: 0.0.0.0
15
+ FLOAT_SUPPORT: n
16
+ DBURL: mysql2://root:root@db/focuslight
17
+ DBTIMEOUT: 60000
18
+ LOG_FILE: log/application.log
19
+ LOG_LEVEL: warn
20
+ tty: true
21
+ stdin_open: true
22
+ depends_on:
23
+ - db
24
+ db:
25
+ image: mysql:5.7
26
+ ports:
27
+ - '4306:3306'
28
+ volumes:
29
+ - db-data:/var/lib/mysql
30
+ environment:
31
+ MYSQL_ROOT_USER: root
32
+ MYSQL_ROOT_PASSWORD: root
33
+ volumes:
34
+ db-data:
35
+ gem-data:
data/focuslight.gemspec CHANGED
@@ -18,7 +18,7 @@ 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
- spec.add_development_dependency "bundler", "~> 1.3"
21
+ spec.add_development_dependency "bundler", "~> 2.1"
22
22
  spec.add_development_dependency "rspec"
23
23
  spec.add_development_dependency "pry"
24
24
  spec.add_development_dependency "pry-nav"
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
 
32
32
  spec.add_runtime_dependency "sinatra"
33
33
  spec.add_runtime_dependency "sinatra-contrib"
34
- spec.add_runtime_dependency "erubis"
34
+ spec.add_runtime_dependency "erubi"
35
35
  spec.add_runtime_dependency "unicorn"
36
36
  spec.add_runtime_dependency "unicorn-worker-killer"
37
37
 
data/view/view_graph.erb CHANGED
@@ -3,7 +3,7 @@
3
3
  <li class="prev <%= params[:t] == 'sh' ? 'active' : '' %>"><a href="<%= url_for link_path, t:'sh' %>">hour・8hours(1min)</a></li>
4
4
  <li class="prev <%= params[:t] == 'sd' ? 'active' : '' %>"><a href="<%= url_for link_path, t:'sd' %>">day・3days(1min)</a></li>
5
5
  <li class="prev <%= params[:t] == 'h' ? 'active' : '' %>"><a href="<%= url_for link_path, t:'h' %>">hour・halfday</a></li>
6
- <li class="<%= ['h','m','sh','sd'].include?(params[:t]) ? '' : 'activate' %>"><a href="<%= url_for link_path %>">day・week</a></li>
6
+ <li class="<%= ['h','m','sh','sd'].include?(params[:t]) ? '' : 'active' %>"><a href="<%= url_for link_path %>">day・week</a></li>
7
7
  <li class="next <%= params[:t] == 'm' ? 'active' : '' %>"><a href="<%= url_for link_path, t:'m' %>">month・year</a></li>
8
8
  </ul>
9
9
  <div class="clearfix"></div>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: focuslight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - TAGOMORI Satoshi
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-06-11 00:00:00.000000000 Z
14
+ date: 2021-02-12 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - "~>"
21
21
  - !ruby/object:Gem::Version
22
- version: '1.3'
22
+ version: '2.1'
23
23
  type: :development
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: '1.3'
29
+ version: '2.1'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: rspec
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -168,7 +168,7 @@ dependencies:
168
168
  - !ruby/object:Gem::Version
169
169
  version: '0'
170
170
  - !ruby/object:Gem::Dependency
171
- name: erubis
171
+ name: erubi
172
172
  requirement: !ruby/object:Gem::Requirement
173
173
  requirements:
174
174
  - - ">="
@@ -290,17 +290,21 @@ executables:
290
290
  extensions: []
291
291
  extra_rdoc_files: []
292
292
  files:
293
- - ".env"
293
+ - ".dockerignore"
294
+ - ".github/workflows/unit-test.yml"
294
295
  - ".gitignore"
295
296
  - ".travis.yml"
296
297
  - CHANGELOG.md
298
+ - Dockerfile
297
299
  - Gemfile
300
+ - Gemfile.lock
298
301
  - LICENSE.txt
299
302
  - Procfile
300
303
  - README.md
301
304
  - Rakefile
302
305
  - bin/focuslight
303
306
  - config.ru
307
+ - docker-compose.yml
304
308
  - focuslight.gemspec
305
309
  - lib/focuslight.rb
306
310
  - lib/focuslight/cli.rb
@@ -361,8 +365,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
361
365
  - !ruby/object:Gem::Version
362
366
  version: '0'
363
367
  requirements: []
364
- rubyforge_project:
365
- rubygems_version: 2.2.2
368
+ rubygems_version: 3.1.2
366
369
  signing_key:
367
370
  specification_version: 4
368
371
  summary: Lightning Fast Graphing/Visualization, built on RRDTool
data/.env DELETED
@@ -1,13 +0,0 @@
1
- DATADIR=./data
2
- PORT=5125
3
- HOST=0.0.0.0
4
- # FRONT_PROXY
5
- # ALLOW_FROM
6
- # 1MIN_METRICS=n
7
- FLOAT_SUPPORT=n # y
8
- DBURL=sqlite://data/gforecast.db
9
- # DBURL=mysql2://root:@localhost/focuslight
10
- # RRDCACHED=n
11
- # MOUNT=/
12
- LOG_PATH=log/application.log
13
- LOG_LEVEL=warn