schema_plus_views 0.2.2 → 0.2.3

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
  SHA1:
3
- metadata.gz: 7fc4b60cc9309357c2da20cbc1f47c1f70a84b7b
4
- data.tar.gz: 373a4c477a67f60bf0eabe36c0091dcdb395123d
3
+ metadata.gz: 3bd09e6485e8794d0454b7d3b6f9e79107f134d2
4
+ data.tar.gz: a5ccbf2996d268630f616dded120613df7f9596a
5
5
  SHA512:
6
- metadata.gz: bc62d9dcaf074c67a6c8541a1e148b9a0c1ae52ef364521f53ece17c872ebb65d5cc6ea8e4a3035ba7d9018d0854e0ba1f1c71924e4c3059f18d56f06244d746
7
- data.tar.gz: ae3921d2c5749cbdc8d298729b9973cc3dd4fcebcebd15e03fb54e7c8b2d1fffeb4fa40957ec57415ce15c06bad0ac7dd20983e588a9d77a064fd8acb78a3eec
6
+ metadata.gz: 04ad39d4d0c9a6cdc8b2624326ff1fd3aac5e8ee3a95ef0fa3d84e17c0573494e2ffbe7de62f46f90bdac073278f9bbc0fd02b2d10db4bb493370f6e43caa2ed
7
+ data.tar.gz: dbe18499e3d0108003110873f3738f99c0350870da6e5c7e338935b2a1f509a336554df69328f476348b10771cdd53a114865ca82c9e9d457f32d1da0e50b794
data/README.md CHANGED
@@ -109,6 +109,7 @@ This returns just the body of the definition, i.e. the part after the `CREATE VI
109
109
 
110
110
  ## History
111
111
 
112
+ * 0.2.3 - Remove unnecessary escaping in dump; use single-quote heredoc
112
113
  * 0.2.2 - Prettier dumps: use heredoc for definition string
113
114
  * 0.2.1 - Fix db:rollback
114
115
  * 0.2.0 - Added :allow_replace option (thanks to [@hcarver](https://github.com/hcarver))
@@ -19,9 +19,12 @@ module SchemaPlus::Views
19
19
  class View < KeyStruct[:name, :definition]
20
20
  def assemble(stream)
21
21
  heredelim = "END_VIEW_#{name.upcase}"
22
- stream.puts " create_view #{name.to_json}, <<-#{heredelim}, :force => true\n"
23
- definition.split("\n").each { |line| stream.puts line.to_json[1...-1] + "\n" }
24
- stream.puts " #{heredelim}\n\n"
22
+ stream.puts <<-ENDVIEW
23
+ create_view "#{name}", <<-'#{heredelim}', :force => true
24
+ #{definition}
25
+ #{heredelim}
26
+
27
+ ENDVIEW
25
28
  end
26
29
  end
27
30
  end
@@ -1,5 +1,5 @@
1
1
  module SchemaPlus
2
2
  module Views
3
- VERSION = "0.2.2"
3
+ VERSION = "0.2.3"
4
4
  end
5
5
  end
data/spec/dumper_spec.rb CHANGED
@@ -48,7 +48,7 @@ describe "Dumper" do
48
48
 
49
49
  def view_re(name, re)
50
50
  heredelim = "END_VIEW_#{name.upcase}"
51
- %r{create_view "#{name}", <<-#{heredelim}, :force => true\n\s*#{re}\s*\n *#{heredelim}$}mi
51
+ %r{create_view "#{name}", <<-'#{heredelim}', :force => true\n\s*#{re}\s*\n *#{heredelim}$}mi
52
52
  end
53
53
 
54
54
  def define_schema_and_data
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema_plus_views
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ronen barzel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-17 00:00:00.000000000 Z
11
+ date: 2015-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord