lux-fw 0.1.17 → 0.1.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.version +1 -1
- data/bin/cli/am +38 -29
- data/bin/cli/assets +8 -4
- data/bin/cli/exceptions +6 -6
- data/bin/cli/generate +0 -0
- data/bin/cli/get +0 -0
- data/bin/cli/nginx +11 -5
- data/bin/cli/routes +0 -0
- data/bin/cli/systemd +36 -0
- data/bin/forever +0 -0
- data/bin/job_que +0 -0
- data/bin/lux +1 -0
- data/lib/common/base32.rb +0 -0
- data/lib/common/class_attributes.rb +13 -4
- data/lib/common/crypt.rb +6 -10
- data/lib/common/dynamic_class.rb +23 -0
- data/lib/common/generic_model.rb +0 -0
- data/lib/common/hash_with_indifferent_access.rb +352 -0
- data/lib/common/method_attr.rb +69 -0
- data/lib/lux/api/api.rb +26 -27
- data/lib/lux/api/lib/application_api.rb +26 -7
- data/lib/lux/api/lib/doc_builder.rb +18 -17
- data/lib/lux/api/lib/dsl.rb +23 -41
- data/lib/lux/api/lib/error.rb +3 -0
- data/lib/lux/api/lib/model_api.rb +22 -20
- data/lib/lux/api/lib/rescue.rb +5 -15
- data/lib/lux/api/lib/response.rb +46 -0
- data/lib/lux/cache/cache.rb +13 -6
- data/lib/lux/cell/cell.rb +3 -14
- data/lib/lux/config/config.rb +4 -3
- data/lib/lux/controller/controller.rb +3 -3
- data/lib/lux/controller/lib/nav.rb +6 -2
- data/lib/lux/error/error.rb +15 -14
- data/lib/lux/helper/helper.rb +5 -5
- data/lib/lux/helper/lib/html_tag.rb +67 -0
- data/lib/lux/html/lib/input_types.rb +26 -16
- data/lib/lux/lib/lux.rb +51 -0
- data/lib/lux/lux.rb +5 -52
- data/lib/lux/page/lib/response.rb +178 -0
- data/lib/lux/page/page.rb +72 -51
- data/lib/lux/rescue_from/rescue_from.rb +8 -6
- data/lib/lux/template/template.rb +1 -0
- data/lib/lux-fw.rb +2 -0
- data/lib/overload/array.rb +4 -0
- data/lib/overload/date.rb +2 -0
- data/lib/overload/hash.rb +19 -10
- data/lib/overload/it.rb +29 -0
- data/lib/overload/object.rb +3 -19
- data/lib/overload/r.rb +53 -0
- data/lib/overload/string.rb +5 -6
- data/lib/overload/string_inflections.rb +4 -3
- data/lib/plugins/assets/assets_plug.rb +9 -4
- data/lib/plugins/assets/helper_module_adapter.rb +4 -2
- data/lib/plugins/db_helpers/link_plugin.rb +2 -2
- data/lib/plugins/db_logger/init.rb +1 -1
- data/lib/vendor/mini_assets/lib/asset/css.rb +19 -0
- data/lib/vendor/mini_assets/lib/asset/js.rb +17 -0
- data/lib/vendor/mini_assets/lib/asset.rb +71 -0
- data/lib/vendor/mini_assets/lib/base/javascript.rb +13 -0
- data/lib/vendor/mini_assets/lib/base/stylesheet.rb +5 -0
- data/lib/vendor/mini_assets/lib/base.rb +69 -0
- data/lib/vendor/mini_assets/lib/manifest.rb +18 -0
- data/lib/vendor/mini_assets/lib/opts.rb +16 -0
- data/lib/vendor/mini_assets/mini_assets.rb +74 -0
- metadata +23 -10
- data/lib/common/class_method_params.rb +0 -94
- data/lib/overload/hash_wia.rb +0 -282
- data/lib/overload/inflections.rb +0 -199
- data/lib/vendor/mini_assets/mini_asset/base.rb +0 -167
- data/lib/vendor/mini_assets/mini_asset/css.rb +0 -38
- data/lib/vendor/mini_assets/mini_asset/js.rb +0 -38
- data/lib/vendor/mini_assets/mini_asset.rb +0 -31
@@ -1,38 +0,0 @@
|
|
1
|
-
class MiniAsset::Js < MiniAsset::Base
|
2
|
-
|
3
|
-
def content_type
|
4
|
-
'text/javascript'
|
5
|
-
end
|
6
|
-
|
7
|
-
def asset_join_string
|
8
|
-
";\n"
|
9
|
-
end
|
10
|
-
|
11
|
-
def cache_file
|
12
|
-
super.sub('.coffee', '.js')
|
13
|
-
end
|
14
|
-
|
15
|
-
def compiled_data
|
16
|
-
return content if ext == :js
|
17
|
-
|
18
|
-
if ext == :coffee && do_compile?
|
19
|
-
coffee_path = './node_modules/coffee-script/bin/coffee'
|
20
|
-
coffee_opts = production? ? '-cp' : '-Mcp --no-header'
|
21
|
-
|
22
|
-
run! "#{coffee_path} #{coffee_opts} '#{local_file}' > '#{cache_file}'"
|
23
|
-
|
24
|
-
data = File.read cache_file
|
25
|
-
data.gsub!(%r{//#\ssourceURL=[\w\-\.\/]+/app/assets/}, '//# sourceURL=/raw_asset/')
|
26
|
-
File.write cache_file, data
|
27
|
-
end
|
28
|
-
|
29
|
-
File.read cache_file
|
30
|
-
end
|
31
|
-
|
32
|
-
def minify!
|
33
|
-
if [:coffee, :js].include?(ext)
|
34
|
-
run! `./node_modules/minifier/index.js --output '#{production_file}' '#{production_file}'`
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# asset = MiniAsset.create 'admin/index.scss'
|
2
|
-
# asset.files # find linked files
|
3
|
-
# asset.compile # compile for production and update public/maifest.json
|
4
|
-
# asset.content_type
|
5
|
-
# asset.compiled_data # get compiled data
|
6
|
-
|
7
|
-
module MiniAsset
|
8
|
-
extend self
|
9
|
-
|
10
|
-
def create file, opts={}
|
11
|
-
type = file.split('.').last.to_sym
|
12
|
-
|
13
|
-
klass = MiniAsset::Js if [:js, :coffee].include?(type)
|
14
|
-
klass = MiniAsset::Css if [:scss].include?(type)
|
15
|
-
|
16
|
-
raise 'Not supported %s' % type unless klass
|
17
|
-
|
18
|
-
klass.new file, opts
|
19
|
-
end
|
20
|
-
|
21
|
-
def manifest json=nil
|
22
|
-
@manifest ||= Pathname.new 'public/assets/manifest.json'
|
23
|
-
@manifest.write '{"files":{}}' unless @manifest.exist?
|
24
|
-
@manifest.write json.to_json if json
|
25
|
-
JSON.load @manifest.read
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
require_relative './mini_asset/base'
|
30
|
-
require_relative './mini_asset/js'
|
31
|
-
require_relative './mini_asset/css'
|