Artem Shoobovych avatar Artem Shoobovych committed 20e6bd6

Added monkey-patch to Slim

Comments (0)

Files changed (2)

.idea/workspace.xml

 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="eb69f89f-0930-4f04-a520-6d18cb228c01" name="Default" comment="">
-      <change type="DELETED" beforePath="$PROJECT_DIR$/vendor/cache/actionmailer-3.2.8.gem" afterPath="" />
-      <change type="DELETED" beforePath="$PROJECT_DIR$/vendor/cache/actionpack-3.2.8.gem" afterPath="" />
-      <change type="DELETED" beforePath="$PROJECT_DIR$/vendor/cache/activemodel-3.2.8.gem" afterPath="" />
-      <change type="DELETED" beforePath="$PROJECT_DIR$/vendor/cache/activerecord-3.2.8.gem" afterPath="" />
-      <change type="DELETED" beforePath="$PROJECT_DIR$/vendor/cache/activeresource-3.2.8.gem" afterPath="" />
-      <change type="DELETED" beforePath="$PROJECT_DIR$/vendor/cache/activesupport-3.2.8.gem" afterPath="" />
-      <change type="DELETED" beforePath="$PROJECT_DIR$/vendor/cache/rails-3.2.8.gem" afterPath="" />
-      <change type="DELETED" beforePath="$PROJECT_DIR$/vendor/cache/railties-3.2.8.gem" afterPath="" />
-      <change type="DELETED" beforePath="$PROJECT_DIR$/vendor/cache/rake-0.9.2.2.gem" afterPath="" />
-      <change type="DELETED" beforePath="$PROJECT_DIR$/vendor/cache/sass-3.2.2.gem" afterPath="" />
-      <change type="DELETED" beforePath="$PROJECT_DIR$/vendor/cache/slim-1.3.3.gem" afterPath="" />
-      <change type="DELETED" beforePath="$PROJECT_DIR$/vendor/cache/sprockets-2.1.3.gem" afterPath="" />
-      <change type="MOVED" beforePath="$PROJECT_DIR$/app/assets/stylesheets/frontend.css" afterPath="$PROJECT_DIR$/app/assets/stylesheets/frontend.css.scss" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/mykolaivautodor.iml" afterPath="$PROJECT_DIR$/.idea/mykolaivautodor.iml" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Gemfile.lock" afterPath="$PROJECT_DIR$/Gemfile.lock" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/Gemfile" afterPath="$PROJECT_DIR$/Gemfile" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/assets/javascripts/frontend.js.coffee" afterPath="$PROJECT_DIR$/app/assets/javascripts/frontend.js.coffee" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/controllers/backoffice_controller.rb" afterPath="$PROJECT_DIR$/app/controllers/backoffice_controller.rb" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/controllers/pages_controller.rb" afterPath="$PROJECT_DIR$/app/controllers/pages_controller.rb" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/helpers/backoffice_helper.rb" afterPath="$PROJECT_DIR$/app/helpers/backoffice_helper.rb" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/models/page.rb" afterPath="$PROJECT_DIR$/app/models/page.rb" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/backoffice/new_page.html.slim" afterPath="$PROJECT_DIR$/app/views/backoffice/new_page.html.slim" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/layouts/frontend.html.slim" afterPath="$PROJECT_DIR$/app/views/layouts/frontend.html.slim" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/pages/index.html.slim" afterPath="$PROJECT_DIR$/app/views/pages/index.html.slim" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/config/application.rb" afterPath="$PROJECT_DIR$/config/application.rb" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/config/database.yml" afterPath="$PROJECT_DIR$/config/database.yml" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/config/routes.rb" afterPath="$PROJECT_DIR$/config/routes.rb" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/db/migrate/20120816115328_create_pages.rb" afterPath="$PROJECT_DIR$/db/migrate/20120816115328_create_pages.rb" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/db/migrate/20120816115405_create_messages.rb" afterPath="$PROJECT_DIR$/db/migrate/20120816115405_create_messages.rb" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/db/schema.rb" afterPath="$PROJECT_DIR$/db/schema.rb" />
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/db/seeds.rb" afterPath="$PROJECT_DIR$/db/seeds.rb" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/config/initializers/monkey_patches.rb" afterPath="$PROJECT_DIR$/config/initializers/monkey_patches.rb" />
     </list>
     <ignored path="mykolaivautodor.iws" />
     <ignored path=".idea/workspace.xml" />
           </provider>
         </entry>
       </file>
-      <file leaf-file-name="slide.css.scss" pinned="false" current="true" current-in-tab="true">
+      <file leaf-file-name="slide.css.scss" pinned="false" current="false" current-in-tab="false">
         <entry file="file://$PROJECT_DIR$/app/assets/themes/slide/stylesheets/slide.css.scss">
           <provider selected="true" editor-type-id="text-editor">
-            <state line="23" column="19" selection-start="314" selection-end="314" vertical-scroll-proportion="0.30279502">
+            <state line="23" column="19" selection-start="314" selection-end="314" vertical-scroll-proportion="0.0">
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="monkey_patches.rb" pinned="false" current="true" current-in-tab="true">
+        <entry file="file://$PROJECT_DIR$/config/initializers/monkey_patches.rb">
+          <provider selected="true" editor-type-id="text-editor">
+            <state line="16" column="32" selection-start="454" selection-end="454" vertical-scroll-proportion="0.38523275">
               <folding />
             </state>
           </provider>
   <component name="IdeDocumentHistory">
     <option name="changedFiles">
       <list>
-        <option value="$PROJECT_DIR$/Gemfile" />
         <option value="$PROJECT_DIR$/config/initializers/slim.rb" />
         <option value="$PROJECT_DIR$/app/controllers/frontend_controller.rb" />
         <option value="$PROJECT_DIR$/config/initializers/themes_for_rails.rb" />
         <option value="$PROJECT_DIR$/config/locales/en.yml" />
         <option value="$PROJECT_DIR$/app/assets/themes/slide/views/layouts/frontend.html.slim" />
         <option value="$PROJECT_DIR$/app/assets/themes/slide/stylesheets/slide.css.scss" />
+        <option value="$PROJECT_DIR$/config/initializers/monkey_patches.rb" />
       </list>
     </option>
   </component>
     <breakpoint-manager />
   </component>
   <component name="editorHistoryManager">
-    <entry file="file://$PROJECT_DIR$/app/controllers/frontend_controller.rb">
-      <provider selected="true" editor-type-id="text-editor">
-        <state line="2" column="2" selection-start="67" selection-end="67" vertical-scroll-proportion="0.0">
-          <folding />
-        </state>
-      </provider>
-    </entry>
     <entry file="file://$PROJECT_DIR$/config/initializers/themes_for_rails.rb">
       <provider selected="true" editor-type-id="text-editor">
         <state line="5" column="50" selection-start="302" selection-end="302" vertical-scroll-proportion="0.0">
     </entry>
     <entry file="file://$PROJECT_DIR$/app/assets/themes/slide/stylesheets/slide.css.scss">
       <provider selected="true" editor-type-id="text-editor">
-        <state line="23" column="19" selection-start="314" selection-end="314" vertical-scroll-proportion="0.30279502">
+        <state line="23" column="19" selection-start="314" selection-end="314" vertical-scroll-proportion="0.0">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/config/initializers/monkey_patches.rb">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="16" column="32" selection-start="454" selection-end="454" vertical-scroll-proportion="0.38523275">
           <folding />
         </state>
       </provider>

config/initializers/monkey_patches.rb

-class Object
-  def with(var, &block)
-    var.instance_eval &block
+module Slim
+  class Parser
+    class SyntaxError < StandardError
+      attr_reader :error, :file, :line, :lineno, :column
+
+      def initialize(error, file, line, lineno, column)
+        @error = error
+        @file = file || '(__TEMPLATE__)'
+        @line = line.to_s
+        @lineno = lineno
+        @column = column
+      end
+
+      def to_s
+        line = @line.strip
+        column = @column + line.size - @line.size
+        column = 0 if column < 0
+
+        %{#{error}
+          #{file}, Line #{lineno}, Column #{@column}
+          #{line}
+          #{' ' * column}^
+        }
+      end
+    end
   end
 end
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.