fit_js 0.94.11 → 0.94.13

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
2
  SHA256:
3
- metadata.gz: 35fe6dfbe6bed02b88cb3959bd38d2b0a64b6f1bbd36c6bcfd5bdf6ca16f1b9a
4
- data.tar.gz: 8dbde6717597e512b806476128f1d206f97ae45788279e0ee09255c951229cbc
3
+ metadata.gz: 78fab59441cf75fd5da4cb44521b58cce8fef33f84ad175488c8c4209d7cb88e
4
+ data.tar.gz: 8b902104a1df686a50914478d9526cc3bffcae0925081b54148e924e696a1ac2
5
5
  SHA512:
6
- metadata.gz: 9b6ed28622bb4252698dd57b63583cff556d299d49ef26a4036dc75739ebe99eb294f3f8d44d9a9a6dc33d8f6195b5805ce745f17e3e34cb6f0c3c020a23c4b4
7
- data.tar.gz: 4c8b27548053c49a064fcdb8ac6ca95c87f30f1f6690ac72861798c47475a5b854245070179a61186bf1ed89015f52038fa6b3a98b65e259948f9ee1a00bb533
6
+ metadata.gz: 2ac1d7d258a692178cfea7d564a7b85fa64403ba792a6eddd1862b15a753146c17465c0319f5d2245a63ded6c16d50dcb26d6fc200c2c9456f20f7eba819b3ea
7
+ data.tar.gz: 9506dd523d6e5db6aa00bc3af06072f234b976ff82ce105706d4492163adc0d10684f3ac43a4875ef7f37aeb6853f91e633e3f4c67a61b49ebaff1f4b5b92517
data/.DS_Store CHANGED
Binary file
data/Rakefile CHANGED
@@ -1,4 +1,6 @@
1
- # frozen_string_literal: true
1
+ require 'bundler/gem_tasks'
2
2
 
3
- require "bundler/gem_tasks"
4
- task default: %i[]
3
+ lib_path = File.join(__dir__, 'lib')
4
+ $:.unshift(lib_path) unless $:.include?(lib_path)
5
+
6
+ load './tasks/bower.rake'
Binary file
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
@@ -9,17 +9,14 @@ Gem::Specification.new do |s|
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.homepage =
13
- "https://rubygems.org/gems/fit_js"
14
- s.license = "MIT"
12
+ s.homepage = "https://github.com/justindunn/fit_js"
13
+ s.license = "MIT"
15
14
 
16
15
 
17
16
  # Dummy Rails app dependencies
18
17
  s.add_development_dependency 'actionpack', '>= 4.1.5'
19
18
  s.add_development_dependency 'activesupport', '>= 4.1.5'
20
19
  s.add_development_dependency 'json', '>= 1.8.1'
21
- s.add_development_dependency 'sprockets-rails', '>= 2.1.3'
22
- s.add_development_dependency 'jquery-rails', '>= 3.1.0'
23
20
  s.add_development_dependency 'slim-rails'
24
21
  s.add_development_dependency 'uglifier'
25
22
 
data/lib/fitjs/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Fitjs
2
- VERSION = "0.94.11"
2
+ VERSION = "0.94.13"
3
3
  API_VERSION = "0.94.0"
4
4
  end
data/lib/fitjs.rb CHANGED
@@ -43,7 +43,5 @@ module Fitjs
43
43
  Sprockets.append_path(javascripts_path)
44
44
  end
45
45
  end
46
- end
47
-
48
46
  Fitjs.load!
49
- end
47
+ 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
@@ -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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fit_js
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.94.11
4
+ version: 0.94.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Dunn
@@ -52,34 +52,6 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.8.1
55
- - !ruby/object:Gem::Dependency
56
- name: sprockets-rails
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: 2.1.3
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: 2.1.3
69
- - !ruby/object:Gem::Dependency
70
- name: jquery-rails
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: 3.1.0
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: 3.1.0
83
55
  - !ruby/object:Gem::Dependency
84
56
  name: slim-rails
85
57
  requirement: !ruby/object:Gem::Requirement
@@ -143,20 +115,22 @@ files:
143
115
  - README.md
144
116
  - Rakefile
145
117
  - assets/.DS_Store
146
- - assets/javascripts/accumulator.js
147
- - assets/javascripts/bit-stream.js
148
- - assets/javascripts/crc-calculator.js
149
- - assets/javascripts/decoder.js
150
- - assets/javascripts/fit.js
118
+ - assets/javascripts/.DS_Store
151
119
  - assets/javascripts/fitjs.js
152
- - assets/javascripts/index.js
153
- - assets/javascripts/profile.js
154
- - assets/javascripts/stream.js
155
- - assets/javascripts/utils-hr-mesg.js
156
- - assets/javascripts/utils-internal.js
157
- - assets/javascripts/utils.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
158
131
  - bin/console
159
132
  - bin/setup
133
+ - bower.json
160
134
  - fit_js.gemspec
161
135
  - lib/.DS_Store
162
136
  - lib/fitjs.rb
@@ -164,7 +138,12 @@ files:
164
138
  - lib/fitjs/engine.rb
165
139
  - lib/fitjs/version.rb
166
140
  - sig/fitjs.rbs
167
- homepage: https://rubygems.org/gems/fit_js
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
168
147
  licenses:
169
148
  - MIT
170
149
  metadata: {}