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.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/.version +1 -1
  3. data/bin/cli/am +38 -29
  4. data/bin/cli/assets +8 -4
  5. data/bin/cli/exceptions +6 -6
  6. data/bin/cli/generate +0 -0
  7. data/bin/cli/get +0 -0
  8. data/bin/cli/nginx +11 -5
  9. data/bin/cli/routes +0 -0
  10. data/bin/cli/systemd +36 -0
  11. data/bin/forever +0 -0
  12. data/bin/job_que +0 -0
  13. data/bin/lux +1 -0
  14. data/lib/common/base32.rb +0 -0
  15. data/lib/common/class_attributes.rb +13 -4
  16. data/lib/common/crypt.rb +6 -10
  17. data/lib/common/dynamic_class.rb +23 -0
  18. data/lib/common/generic_model.rb +0 -0
  19. data/lib/common/hash_with_indifferent_access.rb +352 -0
  20. data/lib/common/method_attr.rb +69 -0
  21. data/lib/lux/api/api.rb +26 -27
  22. data/lib/lux/api/lib/application_api.rb +26 -7
  23. data/lib/lux/api/lib/doc_builder.rb +18 -17
  24. data/lib/lux/api/lib/dsl.rb +23 -41
  25. data/lib/lux/api/lib/error.rb +3 -0
  26. data/lib/lux/api/lib/model_api.rb +22 -20
  27. data/lib/lux/api/lib/rescue.rb +5 -15
  28. data/lib/lux/api/lib/response.rb +46 -0
  29. data/lib/lux/cache/cache.rb +13 -6
  30. data/lib/lux/cell/cell.rb +3 -14
  31. data/lib/lux/config/config.rb +4 -3
  32. data/lib/lux/controller/controller.rb +3 -3
  33. data/lib/lux/controller/lib/nav.rb +6 -2
  34. data/lib/lux/error/error.rb +15 -14
  35. data/lib/lux/helper/helper.rb +5 -5
  36. data/lib/lux/helper/lib/html_tag.rb +67 -0
  37. data/lib/lux/html/lib/input_types.rb +26 -16
  38. data/lib/lux/lib/lux.rb +51 -0
  39. data/lib/lux/lux.rb +5 -52
  40. data/lib/lux/page/lib/response.rb +178 -0
  41. data/lib/lux/page/page.rb +72 -51
  42. data/lib/lux/rescue_from/rescue_from.rb +8 -6
  43. data/lib/lux/template/template.rb +1 -0
  44. data/lib/lux-fw.rb +2 -0
  45. data/lib/overload/array.rb +4 -0
  46. data/lib/overload/date.rb +2 -0
  47. data/lib/overload/hash.rb +19 -10
  48. data/lib/overload/it.rb +29 -0
  49. data/lib/overload/object.rb +3 -19
  50. data/lib/overload/r.rb +53 -0
  51. data/lib/overload/string.rb +5 -6
  52. data/lib/overload/string_inflections.rb +4 -3
  53. data/lib/plugins/assets/assets_plug.rb +9 -4
  54. data/lib/plugins/assets/helper_module_adapter.rb +4 -2
  55. data/lib/plugins/db_helpers/link_plugin.rb +2 -2
  56. data/lib/plugins/db_logger/init.rb +1 -1
  57. data/lib/vendor/mini_assets/lib/asset/css.rb +19 -0
  58. data/lib/vendor/mini_assets/lib/asset/js.rb +17 -0
  59. data/lib/vendor/mini_assets/lib/asset.rb +71 -0
  60. data/lib/vendor/mini_assets/lib/base/javascript.rb +13 -0
  61. data/lib/vendor/mini_assets/lib/base/stylesheet.rb +5 -0
  62. data/lib/vendor/mini_assets/lib/base.rb +69 -0
  63. data/lib/vendor/mini_assets/lib/manifest.rb +18 -0
  64. data/lib/vendor/mini_assets/lib/opts.rb +16 -0
  65. data/lib/vendor/mini_assets/mini_assets.rb +74 -0
  66. metadata +23 -10
  67. data/lib/common/class_method_params.rb +0 -94
  68. data/lib/overload/hash_wia.rb +0 -282
  69. data/lib/overload/inflections.rb +0 -199
  70. data/lib/vendor/mini_assets/mini_asset/base.rb +0 -167
  71. data/lib/vendor/mini_assets/mini_asset/css.rb +0 -38
  72. data/lib/vendor/mini_assets/mini_asset/js.rb +0 -38
  73. 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'