fit_js 0.94.10 → 0.94.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.DS_Store +0 -0
- data/Rakefile +5 -3
- data/{app/assets → assets}/.DS_Store +0 -0
- data/assets/javascripts/.DS_Store +0 -0
- data/{app/assets/javascripts → assets/javascripts/fitjs}/accumulator.js +0 -0
- data/{app/assets/javascripts → assets/javascripts/fitjs}/bit-stream.js +0 -0
- data/{app/assets/javascripts → assets/javascripts/fitjs}/crc-calculator.js +0 -0
- data/{app/assets/javascripts → assets/javascripts/fitjs}/decoder.js +0 -0
- data/{app/assets/javascripts → assets/javascripts/fitjs}/fit.js +0 -0
- data/{app/assets/javascripts → assets/javascripts/fitjs}/index.js +0 -0
- data/{app/assets/javascripts → assets/javascripts/fitjs}/profile.js +0 -0
- data/{app/assets/javascripts → assets/javascripts/fitjs}/stream.js +0 -0
- data/{app/assets/javascripts → assets/javascripts/fitjs}/utils-hr-mesg.js +0 -0
- data/{app/assets/javascripts → assets/javascripts/fitjs}/utils-internal.js +0 -0
- data/{app/assets/javascripts → assets/javascripts/fitjs}/utils.js +0 -0
- data/{app/assets → assets}/javascripts/fitjs.js +0 -0
- data/bower.json +24 -0
- data/fit_js.gemspec +13 -14
- data/{app → lib}/.DS_Store +0 -0
- data/lib/fitjs/.DS_Store +0 -0
- data/lib/fitjs/engine.rb +11 -0
- data/lib/fitjs/version.rb +4 -0
- data/lib/fitjs.rb +42 -7
- data/tasks/.DS_Store +0 -0
- data/tasks/bower.rake +25 -0
- data/tasks/converter/js_conversion.rb +34 -0
- data/tasks/converter.rb +48 -0
- data/templates/project/manifest.rb +14 -0
- metadata +79 -28
- data/lib/fitjs/rails/version.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a97c9ff814b0c0f64bca577b7eef8c3c4d13c34fa516d860602c54c383e3e5e0
|
4
|
+
data.tar.gz: 9606356baa0d7e63c27954120873b7e947d138d0be1b93b5e60c6bae88796a51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b99c8f5b822215c133fa1cd644969939193cd7b57c0bb4f2a538d9c4367545a410146336803301f4dcc272f7c1a3ab1c171a7b23d9caacc6fcade4fb3ea68311
|
7
|
+
data.tar.gz: a8e29c61e525628bcdd652af577e550565f6f5079aef5c423827c94e587b84bfaf353dd264876a32c6d6ffc2f45c3b6306b68c2798347c2f8cf4aaf1cfb615e0
|
data/.DS_Store
CHANGED
Binary file
|
data/Rakefile
CHANGED
Binary file
|
Binary file
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/bower.json
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"name": "fitjs",
|
3
|
+
"homepage": "https://github.com/justindunn/fit_js",
|
4
|
+
"authors": [
|
5
|
+
"Justin Dunn"
|
6
|
+
],
|
7
|
+
"description": "Fitjs rails fit file js library.",
|
8
|
+
"moduleType": "globals",
|
9
|
+
"main": [
|
10
|
+
"assets/javascripts/bootstrap.js"
|
11
|
+
],
|
12
|
+
"keywords": [
|
13
|
+
"fitjs"
|
14
|
+
],
|
15
|
+
"license": "MIT",
|
16
|
+
"ignore": [
|
17
|
+
"**/.*",
|
18
|
+
"lib",
|
19
|
+
"tasks",
|
20
|
+
"*.gemspec",
|
21
|
+
"Rakefile",
|
22
|
+
"Gemfile"
|
23
|
+
]
|
24
|
+
}
|
data/fit_js.gemspec
CHANGED
@@ -1,26 +1,25 @@
|
|
1
|
-
# coding: utf-8
|
2
1
|
lib = File.expand_path('../lib', __FILE__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'fitjs/version'
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "fit_js"
|
7
|
-
s.version =
|
7
|
+
s.version = Fitjs::VERSION
|
8
8
|
s.summary = "Javascript Wrapper for FIT Files"
|
9
9
|
s.description = "The javascript library for the Garmin FIT file format"
|
10
10
|
s.authors = ["Justin Dunn"]
|
11
11
|
s.email = "axeouse@gmail.com"
|
12
|
-
s.
|
13
|
-
s.
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
s.
|
20
|
-
s.
|
21
|
-
s.
|
12
|
+
s.homepage = "https://github.com/justindunn/fit_js"
|
13
|
+
s.license = "MIT"
|
14
|
+
|
15
|
+
|
16
|
+
# Dummy Rails app dependencies
|
17
|
+
s.add_development_dependency 'actionpack', '>= 4.1.5'
|
18
|
+
s.add_development_dependency 'activesupport', '>= 4.1.5'
|
19
|
+
s.add_development_dependency 'json', '>= 1.8.1'
|
20
|
+
s.add_development_dependency 'slim-rails'
|
21
|
+
s.add_development_dependency 'uglifier'
|
22
22
|
|
23
|
-
s.add_development_dependency "bundler", "~> 1.16"
|
24
|
-
s.add_development_dependency "rake", "~> 10.0"
|
25
23
|
s.add_runtime_dependency 'autoprefixer-rails', '~> 9.1', '>= 9.1.0'
|
24
|
+
s.files = `git ls-files`.split("\n")
|
26
25
|
end
|
data/{app → lib}/.DS_Store
RENAMED
Binary file
|
data/lib/fitjs/.DS_Store
ADDED
Binary file
|
data/lib/fitjs/engine.rb
ADDED
data/lib/fitjs.rb
CHANGED
@@ -1,14 +1,49 @@
|
|
1
1
|
require "fitjs/rails/version"
|
2
2
|
|
3
3
|
module Fitjs
|
4
|
-
class
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
4
|
+
class << self
|
5
|
+
# Inspired by Bootstrap
|
6
|
+
def load!
|
7
|
+
if rails?
|
8
|
+
register_rails_engine
|
9
|
+
elsif sprockets?
|
10
|
+
register_sprockets
|
11
11
|
end
|
12
12
|
end
|
13
|
+
|
14
|
+
# Paths
|
15
|
+
def gem_path
|
16
|
+
@gem_path ||= File.expand_path '..', File.dirname(__FILE__)
|
17
|
+
end
|
18
|
+
|
19
|
+
def javascripts_path
|
20
|
+
File.join assets_path, 'javascripts'
|
21
|
+
end
|
22
|
+
|
23
|
+
def assets_path
|
24
|
+
@assets_path ||= File.join gem_path, 'assets'
|
25
|
+
end
|
26
|
+
|
27
|
+
# Environment detection helpers
|
28
|
+
def sprockets?
|
29
|
+
defined?(::Sprockets)
|
30
|
+
end
|
31
|
+
|
32
|
+
def rails?
|
33
|
+
defined?(::Rails)
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def register_rails_engine
|
39
|
+
require 'fitjs/engine'
|
40
|
+
end
|
41
|
+
|
42
|
+
def register_sprockets
|
43
|
+
Sprockets.append_path(javascripts_path)
|
44
|
+
end
|
13
45
|
end
|
46
|
+
end
|
47
|
+
|
48
|
+
Fitjs.load!
|
14
49
|
end
|
data/tasks/.DS_Store
ADDED
Binary file
|
data/tasks/bower.rake
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'find'
|
2
|
+
require 'json'
|
3
|
+
require 'pathname'
|
4
|
+
|
5
|
+
namespace :bower do
|
6
|
+
|
7
|
+
find_files = ->(path) {
|
8
|
+
Find.find(Pathname.new(path).relative_path_from(Pathname.new Dir.pwd).to_s).map do |path|
|
9
|
+
path if File.file?(path)
|
10
|
+
end.compact
|
11
|
+
}
|
12
|
+
|
13
|
+
desc 'update main and version in bower.json'
|
14
|
+
task :generate do
|
15
|
+
Dir.chdir Fitjs.gem_path do
|
16
|
+
spec = JSON.parse(File.read 'bower.json')
|
17
|
+
spec['main'] = %w(assets/javascripts/fitjs.js)
|
18
|
+
spec['version'] = Fitjs::VERSION
|
19
|
+
|
20
|
+
File.open('bower.json', 'w') do |f|
|
21
|
+
f.puts JSON.pretty_generate(spec)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
class Converter
|
2
|
+
module JsConversion
|
3
|
+
def process_javascript_assets
|
4
|
+
log_status 'Processing javascripts...'
|
5
|
+
save_to = @save_to[:js]
|
6
|
+
contents = {}
|
7
|
+
read_files('js', js_files).each do |name, file|
|
8
|
+
contents[name] = file
|
9
|
+
save_file("#{save_to}/#{name}", file)
|
10
|
+
end
|
11
|
+
log_processed "#{js_files * ' '}"
|
12
|
+
|
13
|
+
log_status 'Updating javascript manifest'
|
14
|
+
manifest = ''
|
15
|
+
js_files.each do |name|
|
16
|
+
name = name.gsub(/\.js$/, '')
|
17
|
+
manifest << "//= require ./fitjs/#{name}\n"
|
18
|
+
end
|
19
|
+
dist_js = read_files('/', %w(fitjs.js))
|
20
|
+
{
|
21
|
+
'assets/javascripts/fit-compiled.js' => manifest,
|
22
|
+
'assets/javascripts/fitjs.js' => dist_js['fitjs.js']
|
23
|
+
}.each do |path, content|
|
24
|
+
save_file path, content
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def js_files
|
29
|
+
@js_files ||= begin
|
30
|
+
files = get_paths_by_type('js', /\.js$/).reject { |path| path =~ %r(^tests/) }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/tasks/converter.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# Based on convert script from vwall/compass-twitter-bootstrap gem.
|
3
|
+
# https://github.com/vwall/compass-twitter-bootstrap/blob/master/build/convert.rb
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this work except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License in the LICENSE file, or at:
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
require 'open-uri'
|
18
|
+
require 'json'
|
19
|
+
require 'fileutils'
|
20
|
+
|
21
|
+
require_relative 'converter/js_conversion'
|
22
|
+
|
23
|
+
class Converter
|
24
|
+
include JsConversion
|
25
|
+
|
26
|
+
def initialize(save_to: {}, cache_path: 'tmp/converter-cache-fitjs')
|
27
|
+
@cache_path = cache_path
|
28
|
+
@save_to = {
|
29
|
+
js: 'assets/javascripts/fitjs'}.merge(save_to)
|
30
|
+
end
|
31
|
+
|
32
|
+
def process_bootstrap
|
33
|
+
puts " save to: #{@save_to.to_json}"
|
34
|
+
puts " twbs cache: #{@cache_path}"
|
35
|
+
puts '-' * 60
|
36
|
+
|
37
|
+
@save_to.each { |_, v| FileUtils.mkdir_p(v) }
|
38
|
+
|
39
|
+
process_javascript_assets
|
40
|
+
end
|
41
|
+
|
42
|
+
def save_file(path, content, mode='w')
|
43
|
+
dir = File.dirname(path)
|
44
|
+
FileUtils.mkdir_p(dir) unless File.directory?(dir)
|
45
|
+
File.open(path, mode) { |file| file.write(content) }
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
description 'FIT FILE JS LIBRARY'
|
2
|
+
|
3
|
+
manifest = Pathname.new(File.dirname(__FILE__))
|
4
|
+
assets = File.expand_path('../../assets', manifest)
|
5
|
+
{
|
6
|
+
:javascript => 'javascripts'
|
7
|
+
}.each do |method, dir|
|
8
|
+
root = Pathname.new(assets).join(dir)
|
9
|
+
Dir.glob root.join('**', '*.*') do |path|
|
10
|
+
path = Pathname.new(path)
|
11
|
+
send method, path.relative_path_from(manifest).to_s, :to => path.relative_path_from(root).to_s
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
metadata
CHANGED
@@ -1,43 +1,85 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fit_js
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.94.
|
4
|
+
version: 0.94.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Dunn
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2023-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: actionpack
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.1.5
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 4.1.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 4.1.5
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 4.1.5
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: json
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.8.1
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.8.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: slim-rails
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: uglifier
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
39
81
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
82
|
+
version: '0'
|
41
83
|
- !ruby/object:Gem::Dependency
|
42
84
|
name: autoprefixer-rails
|
43
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,27 +114,36 @@ files:
|
|
72
114
|
- LICENSE.txt
|
73
115
|
- README.md
|
74
116
|
- Rakefile
|
75
|
-
-
|
76
|
-
-
|
77
|
-
-
|
78
|
-
-
|
79
|
-
-
|
80
|
-
-
|
81
|
-
-
|
82
|
-
-
|
83
|
-
-
|
84
|
-
-
|
85
|
-
-
|
86
|
-
-
|
87
|
-
-
|
88
|
-
-
|
117
|
+
- assets/.DS_Store
|
118
|
+
- assets/javascripts/.DS_Store
|
119
|
+
- assets/javascripts/fitjs.js
|
120
|
+
- assets/javascripts/fitjs/accumulator.js
|
121
|
+
- assets/javascripts/fitjs/bit-stream.js
|
122
|
+
- assets/javascripts/fitjs/crc-calculator.js
|
123
|
+
- assets/javascripts/fitjs/decoder.js
|
124
|
+
- assets/javascripts/fitjs/fit.js
|
125
|
+
- assets/javascripts/fitjs/index.js
|
126
|
+
- assets/javascripts/fitjs/profile.js
|
127
|
+
- assets/javascripts/fitjs/stream.js
|
128
|
+
- assets/javascripts/fitjs/utils-hr-mesg.js
|
129
|
+
- assets/javascripts/fitjs/utils-internal.js
|
130
|
+
- assets/javascripts/fitjs/utils.js
|
89
131
|
- bin/console
|
90
132
|
- bin/setup
|
133
|
+
- bower.json
|
91
134
|
- fit_js.gemspec
|
135
|
+
- lib/.DS_Store
|
92
136
|
- lib/fitjs.rb
|
93
|
-
- lib/fitjs
|
137
|
+
- lib/fitjs/.DS_Store
|
138
|
+
- lib/fitjs/engine.rb
|
139
|
+
- lib/fitjs/version.rb
|
94
140
|
- sig/fitjs.rbs
|
95
|
-
|
141
|
+
- tasks/.DS_Store
|
142
|
+
- tasks/bower.rake
|
143
|
+
- tasks/converter.rb
|
144
|
+
- tasks/converter/js_conversion.rb
|
145
|
+
- templates/project/manifest.rb
|
146
|
+
homepage: https://github.com/justindunn/fit_js
|
96
147
|
licenses:
|
97
148
|
- MIT
|
98
149
|
metadata: {}
|