This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler' | |
require 'net/http' | |
require 'json' | |
require 'uri' | |
# Function to fetch gem information from RubyGems.org | |
def fetch_gem_info(gem_name) | |
url = URI("https://rubygems.org/api/v1/gems/#{gem_name}.json") | |
response = Net::HTTP.get_response(url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'syntax_tree' | |
gem 'syntax_tree_ext' | |
gem 'node_query' | |
gem 'node_mutation' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const snippet = "react/html-elements-to-react-bootstrap-components" | |
require(`../../lib/${snippet}`); | |
const dedent = require('dedent'); | |
const { assertConvert } = require("../utils"); | |
describe(snippet, () => { | |
describe("simple", () => { | |
const input = dedent(` | |
import React from 'react'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Synvert = require("synvert-core"); | |
new Synvert.Rewriter("react", "html-elements-to-react-bootstrap-components", () => { | |
description("convert html elements to react bootstrap components"); | |
withinFiles(Synvert.ALL_FILES, function () { | |
let needImport = false | |
withNode({ type: "JSXElement", openingElement: { name: { name: "div" } } }, () => { | |
let matched = false; | |
gotoNode("openingElement", () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-['.'] | |
+%w[.] | |
-included do | |
- has_many :build_items, dependent: :destroy | |
-end | |
+included { has_many :build_items, dependent: :destroy } | |
-array.each { |element| element.to_s } | |
+array.each(&:to_s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Jekyll.logger.error "Dependency Error:", <<~MSG | |
- Yikes! It looks like you don't have #{name} or one of its dependencies installed. | |
+ Yikes! It looks like you don't have #{name} or one of its dependencies installed. | |
In order to use Jekyll as currently configured, you'll need to install this gem. | |
If you've run Jekyll with `bundle exec`, ensure that you have included the #{name} | |
- gem in your Gemfile as well. | |
+ gem in your Gemfile as well. | |
- The full error message from Ruby is: '#{e.message}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- args = args.strip.split(" ") # Shellwords? | |
+ args = args.strip.split(" ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- args = args.strip.split(" ") # Shellwords? | |
+ args = args.strip.split(" ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def title | |
- Utils.slugify(@obj.data["slug"], :mode => "pretty", :cased => true) || | |
- Utils.slugify(@obj.basename_without_ext, :mode => "pretty", :cased => true) | |
+ Utils.slugify(@obj.data["slug"], :mode => "pretty", :cased => true) || Utils.slugify(@obj.basename_without_ext, :mode => "pretty", :cased => true) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-drive = Dir.pwd.sub(%r!^([^\/]+).*!, '\1') | |
+drive = Dir.pwd.sub(%r!^([^\/]+).*!, "\\1") | |
-require_relative "liquid_renderer/file" | |
+require_relative("liquid_renderer/file") |
NewerOlder