Permalink
Browse files

Changed how tokei searches through files.

Updated dependencies
Changed languages.json formatting
  • Loading branch information...
Aaronepower committed Aug 10, 2017
1 parent 6761589 commit f53c796f27d337f3160cb8e6357866d29c6ff5be
Showing with 322 additions and 775 deletions.
  1. +62 −28 Cargo.lock
  2. +2 −2 Cargo.toml
  3. +16 −13 build.rs
  4. +200 −591 languages.json
  5. +2 −45 src/language/language.rs
  6. +10 −12 src/language/language_type.hbs.rs
  7. +26 −66 src/language/languages.rs
  8. +0 −4 src/lib.rs
  9. +4 −14 src/utils/macros.rs
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -32,14 +32,13 @@ lto=true
serde_json = "1"
ignore = "0.2"
handlebars = "0.27"
lazy_static = "0.2"
[dependencies]
encoding = "0.2"
errln = "0.1"
ignore = "0.2"
lazy_static = "0.2"
log = "0.3"
maplit = "0.1"
rayon = "0.7"
regex = "0.2"
clap = "2.24"
@@ -78,6 +77,7 @@ version = "0.4"
[dev-dependencies]
tempdir = "0.3"
lazy_static = "0.2"
[features]
all = ["json", "cbor", "toml-io", "yaml"]
View
@@ -1,6 +1,6 @@
extern crate serde_json;
extern crate ignore;
extern crate handlebars;
extern crate ignore;
extern crate serde_json;
use std::env;
use std::fs::File;
@@ -17,21 +17,24 @@ fn main() {
}
fn generate_languages(out_dir: &OsStr) {
let mut handlebars = Handlebars::new();
handlebars.register_escape_fn(handlebars::no_escape);
let data: Value = serde_json::from_reader(
File::open(&"languages.json").expect("Can't open JSON")
).expect("Can't parse JSON");
let out = Path::new(&out_dir).join("language_type.rs");
let handlebars = {
let mut h = Handlebars::new();
h.register_escape_fn(handlebars::no_escape);
h
};
let json: Value = {
let json = File::open(&"languages.json").expect("Cant open json");
serde_json::from_reader(json).expect("Can't parse json")
};
let output = Path::new(&out_dir).join("language_type.rs");
let mut source_template = File::open(&"src/language/language_type.hbs.rs")
.expect("Can't find Template");
let mut output_file = File::create(&out).expect("Can't create output");
let mut output_file = File::create(&output).expect("Can't create output");
if let Err(err) = handlebars.template_renderw2(&mut source_template,
&data,
&json,
&mut output_file)
{
panic!("Failed to generate languages! ERROR: {:?}", err);
Oops, something went wrong.

0 comments on commit f53c796

Please sign in to comment.