mt-lang 0.2.1 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 674b0b4200e91d6f15e00e5f29a7c7fb08e8f29549eed1bc2aa086af712f27a6
4
- data.tar.gz: c91ff46875de1ea0f5494e715cb9fe67b1c216183e46032b2cf792f5c1a2bfc8
3
+ metadata.gz: 4cffe1ff676e4ac5144fe70cf4e7be194072adc1291c59fa38678e1f4082e00f
4
+ data.tar.gz: 0bc2bf96c010bab477df55452c835bd82ff6e18ce96d2b3f18ce6fa648ae2f59
5
5
  SHA512:
6
- metadata.gz: b1b2cff5b93feba84a850828d6ce2e8be203c8e0758d06c3cb709963d2fec58864ec999a81ac36391fc9afb33e34fc645570bae2a9b21d593a9b5463bd6c6728
7
- data.tar.gz: 9926b26aa493fd673f483bb527364adf2a9d81d2c009caf210f7f65fde3c5296f42dca1e9fab83aa89cc108e175bab22ddf9d1954348811ac664653b84097385
6
+ metadata.gz: 24e0c9b23bdde1e472073a5fcbf39ac5742bce6df1ccc7b1688a7fffed9ad71aa8f681056e582e3d310a338790045a23f292daf91872b511eaa92576fa320adf
7
+ data.tar.gz: 3e33af1f89a1c8571182fd11bbec65e10088c51f0f2105af131f50dccc77e93aa06cd05dd3aa4b666038d080f2dc52f4da9935686df8ec97d88b915d5663d91c
data/README.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Milk Tea
2
2
 
3
+ A statically typed, indentation-based systems language for games.
4
+ Compiles to readable C. Safe by default, explicit by design.
5
+
6
+ ```bash
7
+ gem install mt-lang
8
+ mtc run hello.mt
9
+ ```
10
+
11
+ [VS Code extension](https://marketplace.visualstudio.com/items?itemName=teefan.milk-tea-lang) — syntax highlighting, IntelliSense, debugging
12
+
13
+ ---
14
+
3
15
  This README is the primary, implementation-focused language reference for the project.
4
16
  It is the preferred first entry point for getting to know the language.
5
17
 
data/Rakefile CHANGED
@@ -296,7 +296,7 @@ namespace :release do
296
296
  desc "Build and publish the gem to RubyGems.org"
297
297
  task :push do
298
298
  sh "gem build milk_tea.gemspec"
299
- gem_file = Dir["milk_tea-*.gem"].sort_by { |f| File.mtime(f) }.last
299
+ gem_file = Dir["mt-lang-*.gem"].sort_by { |f| File.mtime(f) }.last
300
300
  sh "gem push #{gem_file}"
301
301
  end
302
302
  end
data/docs/index.html CHANGED
@@ -270,7 +270,16 @@ p + p{margin-top:-.25rem}
270
270
  <div class="hero">
271
271
  <h1>Milk Tea <span>Reference</span></h1>
272
272
  <p class="tagline">A statically typed, indentation-based systems language for games. Safe by default, explicit by design, compiling to <strong>beautiful C</strong>.</p>
273
+ <div class="code-wrap" style="margin-bottom:1rem">
274
+ <button class="copy-btn" onclick="copyCode(this)">Copy</button>
275
+ <pre><code>$ gem install mt-lang
276
+ $ mtc run hello.mt</code></pre>
277
+ </div>
273
278
  <div class="badges">
279
+ <span class="badge">&#128230; Install: <code>gem install mt-lang</code></span>
280
+ <span class="badge ac"><a href="https://marketplace.visualstudio.com/items?itemName=teefan.milk-tea-lang" style="color:inherit;text-decoration:none">&#128187; VS Code Extension</a></span>
281
+ </div>
282
+ <div class="badges" style="margin-top:.5rem">
274
283
  <span class="badge">&#9889; Statically Typed</span>
275
284
  <span class="badge">&#127758; Compiles to C</span>
276
285
  <span class="badge ac">&#128274; Safe by Default</span>
data/lib/milk_tea/base.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  require "pathname"
4
4
 
5
5
  module MilkTea
6
- VERSION = "0.2.1"
6
+ VERSION = "0.2.2"
7
7
 
8
8
  def self.root
9
9
  @root ||= Pathname.new(File.expand_path("../..", __dir__))
@@ -11,7 +11,7 @@ module MilkTea
11
11
 
12
12
  def self.data_root
13
13
  @data_root ||= begin
14
- if File.writable?(root.to_s)
14
+ if !installed_as_gem? && File.writable?(root.to_s)
15
15
  root
16
16
  else
17
17
  xdg_cache = ENV.fetch("XDG_CACHE_HOME", File.join(Dir.home, ".cache"))
@@ -20,6 +20,11 @@ module MilkTea
20
20
  end
21
21
  end
22
22
 
23
+ def self.installed_as_gem?
24
+ root.to_s.match?(%r{/gems/mt-lang-})
25
+ end
26
+ private_class_method :installed_as_gem?
27
+
23
28
  def self.writable_root_for(root)
24
29
  resolved = Pathname.new(File.expand_path(root.to_s))
25
30
  if resolved.to_s == MilkTea.root.to_s
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mt-lang
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Long (Teefan) Tran
@@ -583,7 +583,7 @@ metadata:
583
583
  homepage_uri: https://teefan.github.io/mt-lang/
584
584
  source_code_uri: https://github.com/teefan/mt-lang
585
585
  post_install_message: |
586
- Milk Tea 0.2.1 installed!
586
+ Milk Tea 0.2.2 installed!
587
587
 
588
588
  System requirements:
589
589
  - A C compiler (gcc or clang) must be available on PATH