zwr 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5c0ba53990f67d1163f5c91d7c2433ebab1f2d5e
4
+ data.tar.gz: e99335660b6f18ad0ca1d3efe95f106564bbb413
5
+ SHA512:
6
+ metadata.gz: 48a9597f7ad6b84ea8e92b05545c04e47fdffe7588ac6080f78cb551965ae4a8c77ebff1d3ab7801fb9b8412bc0506a1a4b5e61f1c15fd7105507f9bdbe3cdad
7
+ data.tar.gz: 6827685e6c730b4a9b8c9e8df4e8c41438e8b58fc74d5a677d46a420579149d123bc601d864fc838b7ace6e9750a2d52b0f33ea3826beb19f87475169f02e5d1
@@ -0,0 +1,21 @@
1
+ namespace :loc do
2
+ def extract_from(folder)
3
+ Dir.entries(folder).each do |fof|
4
+ if File.directory?(fof_full = File.join(folder,fof)) and fof !='.' and fof != '..'
5
+ extract_from fof_full
6
+ else
7
+ if File.extname(fof_full) == ".haml"
8
+ File.open(fof_full).read().scan(/=t :'(.+)'(\s*#\s*(.+))?/) do |match|
9
+ sym = match[0].gsub("#","\\#")
10
+ puts %{ "#{sym}":}.ljust(30) + %{"#{match[2] || match[0]}"}
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
16
+
17
+ desc "extracts all localized strings from all HAML files"
18
+ task :extract do
19
+ extract_from Rails.root
20
+ end
21
+ end
data/lib/zwr.rb ADDED
@@ -0,0 +1,3 @@
1
+ module Zwr
2
+ require 'zwr/railtie' if defined?(Rails)
3
+ end
@@ -0,0 +1,13 @@
1
+ require 'zwr'
2
+ require 'rails'
3
+ module Zwr
4
+ class Railtie < Rails::Railtie
5
+ railtie_name :zwr
6
+
7
+ rake_tasks do
8
+ load "tasks/loc.rake"
9
+ end
10
+
11
+ Sprockets::Context.send :include, ActionView::Helpers::TranslationHelper
12
+ end
13
+ end
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: zwr
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Zeljko
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-26 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A gem in which I jam what I commonly use.
14
+ email: zeljko@zwr.fi
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/tasks/loc.rake
20
+ - lib/zwr.rb
21
+ - lib/zwr/railtie.rb
22
+ homepage: http://rubygems.org/gems/zwr
23
+ licenses:
24
+ - MIT
25
+ metadata: {}
26
+ post_install_message:
27
+ rdoc_options: []
28
+ require_paths:
29
+ - lib
30
+ required_ruby_version: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ required_rubygems_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ requirements: []
41
+ rubyforge_project:
42
+ rubygems_version: 2.2.2
43
+ signing_key:
44
+ specification_version: 4
45
+ summary: All the Zwr needs
46
+ test_files: []